canvas
npmv3.2.3TypeScriptCanvas graphics API backed by Cairo
Adopt with care
canvas is usable, with caveats. This package runs an install script on your machine.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- BMaintenance: grade B, Good.
Last published 163 days ago. 13 releases in the last 2 years.
- AWeight: grade A, Excellent.
Pulls in 2 transitive packages, about 393 KB installed (at least — some of the tree is still being crawled).
- CSupply chain: grade C, Fair — worth a look.
This package runs an install script on your machine.
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding canvas to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Part of this dependency tree has not been crawled yet, so these figures are a lower bound rather than a final total.
Compatibility
- Node.js
- node ^18.12.0 || >= 20.9.0
- Module format
- CommonJS only
- TypeScript
- Types included
- Install scripts
- Runs on install
Installing this package executes a script defined by its publisher. That is normal for native modules, but it is also how supply-chain attacks run — review it before installing in CI or on a machine with credentials.
Quick start
A usage example from the canvas README.
const { createCanvas, loadImage } = require('canvas')
const canvas = createCanvas(200, 200)
const ctx = canvas.getContext('2d')
// Write "Awesome!"
ctx.font = '30px Impact'
ctx.rotate(0.1)
ctx.fillText('Awesome!', 50, 100)
// Draw line under text
var text = ctx.measureText('Awesome!')
ctx.strokeStyle = 'rgba(0,0,0,0.5)'
ctx.beginPath()
ctx.lineTo(50, 102)canvas vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| canvasthis page | 0 | 1 | MIT | 5 months ago |
| d3-shape | 0 | 2 | ISC | 1 day ago |
| d3-path | 0 | 1 | ISC | 1 day ago |
| buffer-image-size | 0 | 1 | MIT | 1 day ago |
| @blazediff/core | 0 | 1 | MIT | 1 day ago |
| image-size | 0 | 1 | MIT | 1 day ago |
Dependencies
Declared by canvas v3.2.3. Runtime dependencies are installed with the package; dev dependencies are not.
Runtime (2)
Dev (9)
Used by
Popular packages that depend on canvas.
Relationship graph
Dependencies (left) and dependents (right) of canvas.
Frequently installed together
An implementation of the WHATWG URL Standard's URL API and parsing machinery
An HTTP/1.1 client, written from scratch for Node.js
An AST-based pattern checker for JavaScript.
Check whether a given string matches the `PotentialCustomElementName` production as defined in the HTML Standard.
An arbitrary-precision Decimal type for JavaScript.
Implements the WebIDL algorithms for converting to and from JavaScript values
Parses, serializes, and manipulates MIME types, according to the WHATWG MIME Sniffing Standard
CSS color - Resolve and convert CSS colors.
A per-spec XML serializer implementation
Validates whether a string matches the production for an XML name or qualified name
CSS syntax patches for CSS tree
A tool set for CSS: fast detailed parser (CSS → AST), walker (AST traversal), generator (AST → CSS) and lexer (validation and matching) based on specs and browser implementations
Release history
13 releases in the last two years, typically about 16 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 4.0.0-rc3 | 25 days ago | 549 KB | MIT |
| 4.0.0-rc2 | 1 month ago | 547 KB | MIT |
| 4.0.0-rc1 | 1 month ago | 547 KB | MIT |
| 3.2.3latest | 5 months ago | 393 KB | MIT |
| 3.2.2 | 5 months ago | 393 KB | MIT |
| 3.2.1 | 8 months ago | 458 KB | MIT |
| 3.2.0 | 1 year ago | 399 KB | MIT |
| 3.1.2 | 1 year ago | 398 KB | MIT |
| 3.1.1 | 1 year ago | 398 KB | MIT |
| 3.1.0 | 1 year ago | 398 KB | MIT |
| 3.0.1 | 1 year ago | 366 KB | MIT |
| 3.0.0 | 1 year ago | 366 KB | MIT |
| 3.0.0-rc3 | 1 year ago | 367 KB | MIT |
| 3.0.0-rc2 | 2 years ago | 351 KB | MIT |
| 3.0.0-rc1e | 2 years ago | 351 KB | MIT |
Overview
canvas is an npm package that canvas graphics API backed by Cairo. It has 1 known dependents in the graph. The latest version is 3.2.3, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need canvas graphics API backed by Cairo and value a focused solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Frequently asked questions
Should I use canvas?
canvas is usable, with caveats. This package runs an install script on your machine.
How do I install canvas?
Run `npm install canvas` to add canvas to your npm project.
How many dependencies does canvas have?
canvas declares 11 direct dependencies and pulls in 2 packages in total once its runtime tree is resolved totalling about 393 KB on disk.
What license is canvas released under?
canvas is distributed under the MIT license.
How popular is canvas?
npm does not publish download counts. Within PackageGraph's crawl, 1 known packages depend on canvas.
Is canvas still maintained?
The most recent release of canvas (v3.2.3) was published 5 months ago.
Does canvas run install scripts?
Yes. canvas defines a lifecycle script that executes when the package is installed. Review it before installing in CI or on a machine holding credentials.