Skip to content
CAI
Software that uses CAICheck a score

lovell/sharp

52.3

Adequate · 13 November 2026

6.3k

lines of production code

JavaScript

with C++, C

7

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Features

Add ESM and CommonJS export stubs for WebAssembly platforms

The npm package now includes dedicated export files for the freebsd-wasm32 and webcontainers-wasm32 platforms, providing both CommonJS (\.cjs\) and ES Module (\.mjs\) entry points. These stubs re-export package metadata, version information, and the prebuilt WebAssembly binary from the \@img/sharp-wasm32\ package, ensuring that consumers using either module system can correctly resolve the WebAssembly support.

npm · high confidence

Add Emscripten build infrastructure for WebAssembly (wasm32)

This change introduces the necessary build configuration and runtime initialization code to support building the project as a WebAssembly module (wasm32 target). A new \common.gypi\ file defines the Emscripten-specific compiler and linker flags, including thread support and specific exports for VIPS and libuv shutdown functions. Additionally, a \pre.js\ script is added to handle module initialization, setting up the concurrency environment via \VIPS\_CONCURRENCY\, initializing the EMNAPI runtime context, and ensuring proper cleanup of native resources when the process exits.

src/emscripten · high confidence

Architecture

Library refactored into modular ESM source files

The library's internal structure has been reorganized from a single monolithic file into distinct, modular ESM source files (e.g., \lib/channel.mjs\, \lib/colour.mjs\, \lib/composite.mjs\, \lib/constructor.mjs\, \lib/input.mjs\, \lib/operation.mjs\, \lib/output.mjs\, \lib/utility.mjs\). These modules are now aggregated and exported via a new \lib/index.mjs\ entry point, and the TypeScript definitions in \lib/index.d.ts\ have been updated to reflect this new module structure.

lib · high confidence

Behavioural changes

Build script now generates dual ESM/CJS packages and type definitions

The build process has been updated to automatically produce both ES Module (.mjs) and CommonJS (.cjs) output files, along with corresponding TypeScript declaration files (.d.mts and .d.cts). This ensures the library is compatible with both modern ESM-based runtimes and legacy CommonJS environments, resolving previous issues with dual-module support.

scripts · high confidence

Building from source is now opt-in

The installation process no longer attempts to build the native libvips addon from source by default. A new \install/build.js\ script has been introduced to handle source builds, meaning users must now explicitly opt-in to building from source (e.g., by ensuring dependencies like \node-addon-api\ and \node-gyp\ are present) rather than having it happen automatically during installation.

install · high confidence

Sharp v0.33.0: C++17 requirement and libvips 8.18.6 minimum

The native binding now requires a C++17 compiler and libvips 8.18.6 or later, enforced at compile time. The build configuration (binding.gyp) sets the C++17 standard for Windows and uses N-API version 9, while the C++ source files (common.h, common.cc, metadata.cc, operations.cc) are rewritten to use the modern Napi API and the libvips C++ bindings. This change drops support for older Node.js versions and libvips releases, and may require users to update their build toolchains and system dependencies.

src · high confidence

Fixes

Fix wasm32 build by handling shared/resizable memory views in emnapi

The emnapi library patch now correctly handles SharedArrayBuffer and resizable memory buffers when decoding UTF-8 and UTF-16 strings in the wasm32 target. Previously, the code used a helper that likely failed or produced incorrect results with these memory types; the fix introduces a getHeapViewOrCopy function that slices the heap for shared/resizable buffers and uses subarray otherwise, ensuring string decoding works correctly in WebAssembly environments that utilize these advanced memory features.

patches · high confidence

Test coverage

123 commits adding/updating tests in test/fixtures/expected; Add SVG test fixtures and fingerprint-based test helpers; Added Docker-based performance benchmarking suite; Added TypeScript type tests for Sharp; Added automated memory leak detection tests; Expanded unit test coverage for image operations; Migrate unit tests to Node.js native test runner.

Dependencies

Sharp v0.35.5-rc.0 prebuilt binaries and documentation tooling

This release introduces prebuilt native binaries for Sharp v0.35.5-rc.0 across a wide range of platforms, including macOS (arm64, x64), Linux (glibc and musl variants for arm, arm64, ppc64, riscv64, s390x, x64), Windows (arm64, ia32, x64), and FreeBSD (wasm32). The package also adds WebAssembly support via the \@img/sharp-wasm32\ and \@img/sharp-webcontainers-wasm32\ packages, enabling image processing in browser-like environments. Additionally, the documentation site has been updated to use Astro 7 and Starlight 0.42.2 for improved generation and navigation.

(dependencies) · high confidence

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 53 → 52 (-0.3)
  • Rubric changed (rubric-2026.10.5 → rubric-2026.11.3) — scores are not directly comparable.

Lenses

  • Code Health 37 → 37 (+0.0)
  • Architecture 100 → 100 (-0.0)
  • Maturity 55 → 52 (-2.6)
  • Readiness 66 → 70 (+3.9)
  • Security 79 → 76 (-2.8)
  • Performance 91 → 91 (+0.0)

Resolved (2)

  • Scanner failed to run — not a clean result
  • Scanner failed to run — not a clean result

New (4)

  • doc comments repeat the names (lib/colour.mjs)
  • redundant comment (lib/input.mjs)
  • redundant comment (lib/input.mjs)
  • redundant comment (npm/from-local-build.js)

Changes since last survey

  • 18 commits — 17 feature/other, 1 fixes

By area

  • docs/src — 6 commits
  • src/pipeline.cc — 5 commits
  • (root) — 2 commits
  • .github/ISSUE_TEMPLATE — 1 commit
  • .github/workflows — 1 commit
  • lib/operation.mjs — 1 commit
  • src/common.cc — 1 commit
  • src/stats.cc — 1 commit

Notable commits

  • fix: Fix possible race condition in stats and metadata #4660
  • change: Bump deps
  • change: Bump pnpm/action-setup from 6.1.0 to 6.1.1 (#4650)
  • change: Docs: changelog entries for #4652 #4661
  • change: Docs: changelog entry for #4657, plus bump devDeps
  • change: Docs: clarify mozjpeg options and processing time (#4659)
  • change: Docs: correct rgb16 as 16 bits per channel #4648
  • change: Ensure 16-bit P3 input is converted to sRGB for 8-bit output (#4652)
  • change: Ensure CMYK JPEG output info contains correct channel count
  • change: Ensure input-matching output for jxl format
  • change: Ensure invalid blur sigma error messages are useful
  • change: Ensure metadata can be retained in JP2 output (#4661)
  • change: Improve error messaging when multi-page dimension overflow occurs
  • change: Remove dead code from vector-based shrink-on-load path
  • change: Return stats channel min and max as float rather than integer (#4657)
  • change: Simplify gain map detection/removal
  • change: Switch from issue templates to forms, add PR template
  • change: Tighten withExif validation to ensure IFD-prefixed keys

Written by cca.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

lovell/sharp was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 13 November 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 80323211e23afa4f56d63c70e7db17dfd6e588f0 — the exact code this score is about.
  • Scored under rubric-2026.11.3 — the same rubric and the same method as every other entry in this index.
  • Measured by Canine Code Analyzer (cca.canine.dev) using cca measure-2026.11.63+preprod-4a8cc97a9484.