</>PackageGraphPackageGraph

canvas

npmv3.2.3TypeScript

Canvas 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.

2
Direct dependencies

Runtime packages this one declares itself.

2
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

393 KB
Install size

Unpacked size of this package plus its entire runtime tree.

1
Tree depth

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.

javascriptFull 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)
Example truncated — see the full README.

canvas vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
canvasthis page01MIT5 months ago
d3-shape02ISC1 day ago
d3-path01ISC1 day ago
buffer-image-size01MIT1 day ago
@blazediff/core01MIT1 day ago
image-size01MIT1 day ago

Dependencies

Declared by canvas v3.2.3. Runtime dependencies are installed with the package; dev dependencies are not.

Runtime (2)

node-addon-api ^7.0.0prebuild-install ^7.1.3

Dev (9)

@types/node ^10.12.18assert-rejects ^1.0.0express ^4.16.3js-yaml ^4.1.0mocha ^5.2.0pixelmatch ^4.0.2standard ^12.0.1tsd ^0.29.0typescript ^4.2.2

Used by

Popular packages that depend on canvas.

Relationship graph

Dependencies (left) and dependents (right) of canvas.

jsdomcanvas
canvas dependencies dependents

Frequently installed together

whatwg-urlnpm

An implementation of the WHATWG URL Standard's URL API and parsing machinery

204.4M/wk3 dependentsMIT
undicinpm

An HTTP/1.1 client, written from scratch for Node.js

158.5M/wk15 dependentsMITTS
eslintnpm

An AST-based pattern checker for JavaScript.

138.4M/wk279 dependentsMITTS
is-potential-custom-element-namenpm

Check whether a given string matches the `PotentialCustomElementName` production as defined in the HTML Standard.

41.4M/wk2 dependentsMIT
decimal.jsnpm

An arbitrary-precision Decimal type for JavaScript.

0/wk1 dependentsMITTS
webidl-conversionsnpm

Implements the WebIDL algorithms for converting to and from JavaScript values

0/wk2 dependentsBSD-2-Clause
whatwg-mimetypenpm

Parses, serializes, and manipulates MIME types, according to the WHATWG MIME Sniffing Standard

0/wk3 dependentsMIT
@asamuzakjp/css-colornpm

CSS color - Resolve and convert CSS colors.

0/wk1 dependentsMITTS
w3c-xmlserializernpm

A per-spec XML serializer implementation

0/wk1 dependentsMIT
xml-name-validatornpm

Validates whether a string matches the production for an XML name or qualified name

0/wk2 dependentsApache-2.0
@csstools/css-syntax-patches-for-csstreenpm

CSS syntax patches for CSS tree

0/wk1 dependentsMIT-0TS
css-treenpm

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

0/wk5 dependentsMIT

Release history

13 releases in the last two years, typically about 16 days apart.

Recent versions of canvas
VersionPublishedSizeLicense
4.0.0-rc325 days ago549 KBMIT
4.0.0-rc21 month ago547 KBMIT
4.0.0-rc11 month ago547 KBMIT
3.2.3latest5 months ago393 KBMIT
3.2.25 months ago393 KBMIT
3.2.18 months ago458 KBMIT
3.2.01 year ago399 KBMIT
3.1.21 year ago398 KBMIT
3.1.11 year ago398 KBMIT
3.1.01 year ago398 KBMIT
3.0.11 year ago366 KBMIT
3.0.01 year ago366 KBMIT
3.0.0-rc31 year ago367 KBMIT
3.0.0-rc22 years ago351 KBMIT
3.0.0-rc1e2 years ago351 KBMIT

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.

Maintainers

Keywords

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.