node-canvas is a Cairo-backed Canvas implementation for Node.js that brings Web Canvas API functionality to server-side JavaScript environments.
The project solves the problem of generating, manipulating, and rendering graphics programmatically in Node.js without a browser. It wraps Cairo, a mature graphics library, to provide a Canvas API that developers familiar with browser-based canvas drawing can use directly in server applications. This approach allows for image generation, PDF creation, and graphics manipulation on the server side using the same API patterns developers know from the Web platform.
The tool suits projects that need server-side image or PDF generation, such as dynamic image creation services, report generation systems, or graphics processing pipelines. It implements the Web Canvas API as closely as possible, so developers can apply existing canvas knowledge. The project provides utility methods beyond standard Canvas, including image loading, font management, and non-standard output formats like PNG, JPEG, and PDF streams. It requires Node.js 22 or later and provides prebuilt binaries for macOS, Linux, and Windows across multiple architectures, with fallback support for exotic systems via Zig compilation.
The project maintains active continuous integration testing. Development has addressed significant improvements in font handling, worker thread support, and binary size reduction. The tool has expanded platform coverage for prebuilt binaries and removed post-install scripts to simplify installation. The project welcomes contributions for supporting additional exotic systems through its build configuration.