sharp

High-performance Node.js image processing powered by libvips, built for fast resizing and format conversion.

Library
npm
v0.35.5
32,726 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
90 /100 Excellent
Development Activity 100
Maintenance 96
Community 64
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
88 /100 Excellent
Architecture 88
Code Quality 90
Innovation 88
Learning Curve 85

sharp is a high-performance Node.js module for resizing, converting, and manipulating images, built on top of the libvips library. It’s typically used to convert large JPEG, PNG, WebP, AVIF, GIF, and TIFF images into smaller, web-friendly formats and dimensions, and is significantly faster than ImageMagick or GraphicsMagick for most operations because it processes images with minimal memory copying and per-operation streaming.

Beyond resizing, sharp exposes a chainable API for rotation, cropping, compositing, colour space conversion, and gamma correction, with colour spaces, embedded ICC profiles, and alpha transparency handled correctly. It ships prebuilt native bindings for common platforms so most projects can install and use it without a local build toolchain, and it works across Node.js, Deno, and Bun via Node-API.

What You Get

  • A chainable Sharp() pipeline for resize, crop, rotate, composite, and format conversion operations
  • Native bindings via libvips for JPEG, PNG, WebP, AVIF, GIF, TIFF, and SVG input/output
  • Streaming and buffer-based I/O with Promise, callback, and Node.js stream.Duplex support
  • Full TypeScript type definitions and detailed metadata/stats introspection (EXIF, ICC, dimensions)

Common Use Cases

  • Resizing and compressing user-uploaded images for web delivery in an API or CMS backend
  • Generating responsive image variants (thumbnails, srcset sizes) at build or request time
  • Converting legacy formats (BMP, TIFF) to modern web formats like WebP and AVIF

Under The Hood

Architecture

sharp is a thin, chainable JavaScript layer over the libvips C image-processing library, connected through a native Node-API addon (src/sharp.cc, src/pipeline.cc, src/operations.cc). Calling sharp(input) returns a Sharp instance (lib/constructor.mjs) that extends stream.Duplex; each chained method (lib/resize.mjs, lib/composite.mjs, lib/operation.mjs, lib/colour.mjs, lib/channel.mjs, lib/output.mjs) mutates an internal options object rather than executing immediately, and the actual decode/transform/encode pipeline only runs when a terminal method (.toFile(), .toBuffer(), or piping the stream) triggers the native binding (lib/sharp.mjs), which selects a prebuilt sharp-<platform>-<version>.node binary matching the runtime’s OS/arch/libc via detect-libc. This lazy-pipeline-then-native-execute design lets libvips process images with minimal memory copying and per-operation streaming instead of decoding a full raster buffer per JS call.

Tech Stack

The public package is pure ESM/CJS dual-published JavaScript (dist/index.mjs and dist/index.cjs from a build step) with three runtime dependencies: @img/colour, detect-libc, and semver. The native layer is C++ against libvips (>=8.18.3, declared in package.json’s config.libvips) built via node-gyp/node-addon-api, with prebuilt binaries shipped as ~15 platform-specific optionalDependencies (@img/sharp-darwin-arm64, @img/sharp-linux-x64, etc., plus matching @img/sharp-libvips-* packages) so consumers avoid a local C++ toolchain. Node.js >=20.9.0 is required, and Deno/Bun are supported through Node-API v9 compatibility.

Code Quality

The repository has 59 files under test/unit covering individual operations (resize, composite, colour, output format, etc.) plus a separate test/types directory validating the 1,999-line lib/index.d.ts TypeScript definitions, and test/leak for memory-leak regression testing — a notably rigorous setup for a native-binding library. Error handling is centralized through a shared invalidParameterError factory in lib/is.mjs, used consistently (19 call sites) across the option-validation code in resize/operation/output rather than ad hoc throws. Naming is consistent and each public option is documented with JSDoc used to generate the published API docs site.

API Design

The chainable pipeline (sharp(input).resize().jpeg().toFile()) mirrors common Node stream/builder conventions and requires almost no boilerplate to get started — a single sharp(‘in.jpg’).resize(300).toFile(‘out.jpg’) covers the primary use case. Options are grouped logically per operation (resize, composite, output-format-specific encoders) and the library supports Promise, callback, and Duplex-stream usage side by side, so it fits equally into async/await code and pipe-based stream pipelines. The extensive TypeScript definitions and inline JSDoc give strong editor autocomplete and reduce the need to consult external docs for routine operations.

Used by 109 apps in this directory

TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

166

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
31
Repo Health
70
Technical
64
Dependency
Built with
TypeScript 76%
MDX 18%
Updated 1 years ago
TypeScript
100%
Other

Activepieces

AI Assistants · Automation · Mcp

24,756

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
64
Dependency
Built with
TypeScript 100%
Updated 5 days ago
Go
59%
Apache 2.0

agent-orchestrator

AI Agents · AI Code Assistants · Developer Tools

12,440

A local desktop workspace that gives every coding task its own agent, Git branch, and worktree, then tracks tasks, pull requests, CI, and reviews for 27 coding agents on one live Kanban board.

View details
86
Repo Health
83
Technical
68
Dependency
Built with
Go 59%
TypeScript 38%
Updated 5 days ago
TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

33,179

Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.

View details
85
Repo Health
76
Technical
66
Dependency
Built with
TypeScript 95%
Updated 3 weeks ago
TypeScript
54%
MIT

Anarlog

AI Assistants · Note Taking · Productivity

9,404

Anarlog is an open-source, local-first AI meeting notetaker that records, transcribes, and summarizes meetings entirely on your device — no cloud lock-in, no mandatory account, and every note saved as a plain markdown file you own forever.

View details
86
Repo Health
77
Technical
68
Dependency
Built with
TypeScript 54%
Rust 34%
Updated 5 days ago
JavaScript
95%
MIT

AnythingLLM

AI Assistants · Automation · Developer Tools

66,533

The all-in-one AI platform for private document chat, no-code agents, and local LLMs with zero setup friction.

View details
90
Repo Health
78
Technical
64
Dependency
Built with
JavaScript 95%
Updated 1 weeks ago
TypeScript
92%
GPL 3.0

Blinko

Knowledge Management · Note Taking

11,049

A self-hosted, AI-powered card note-taking tool that lets you capture fleeting thoughts instantly and retrieve them with natural language search.

View details
75
Repo Health
69
Technical
63
Dependency
Built with
TypeScript 92%
Updated 1 months ago
TypeScript
80%
GPL 3.0

Bramble

Authentication · Password Manager · Security

399

Local-first, end-to-end encrypted password manager that syncs your vault directly between your own devices over a private peer-to-peer mesh — no server, no account, no cloud in the middle.

View details
75
Repo Health
84
Technical
68
Dependency
Built with
TypeScript 80%
Updated 6 days ago
Rust
67%
MIT

Bun

Developer Tools

96,068

An all-in-one JavaScript and TypeScript toolkit — one Rust-and-JavaScriptCore binary that replaces Node.js, npm, a bundler, and a test runner with faster equivalents.

View details
92
Repo Health
91
Technical
64
Dependency
Built with
Rust 67%
C++ 19%
TypeScript 10%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers