Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 21, 2024 via pnpm

canvas 1.6.9

Canvas graphics API backed by Cairo
Package summary
Share
4
issues
2
high severity
vulnerability
2
2
moderate severity
vulnerability
2
1
license
2
MIT
Package created
19 Dec 2010
Version published
21 Dec 2017
Maintainers
8
Total deps
2
Direct deps
1
License
MIT

Issues

4

2 high severity issues

high
Recommendation: Upgrade to version 1.6.11 or later
via: canvas@1.6.9
Recommendation: Upgrade to version 1.6.11 or later
via: canvas@1.6.9
Collapse
Expand

2 moderate severity issues

moderate
Recommendation: Upgrade to version 1.6.10 or later
via: canvas@1.6.9
Recommendation: Upgrade to version 1.6.10 or later
via: canvas@1.6.9
Collapse
Expand

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
canvas@1.6.9
nan@2.19.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of canvas 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
nan2.19.0419.43 kBMIT
prod

Visualizations

Frequently Asked Questions

What does canvas do?

Node-canvas is a Cairo graphics library-backed canvas implementation for Node.js. It allows users to create programmatically controlled images in web servers and Node.js programs. It can create all type of graphics like lines, text, images including their properties like colors, shape, and style, etc.

How do you use canvas?

To use canvas, Installation is accomplished via npm like so:

$ npm install canvas

You can then require the canvas module and begin creating graphics. Here is a quick example:

const { createCanvas, loadImage } = require('canvas')
const canvas = createCanvas(200, 200)
const ctx = canvas.getContext('2d')

ctx.font = '30px Impact'
ctx.rotate(0.1)
ctx.fillText('Awesome!', 50, 100)

var text = ctx.measureText('Awesome!')
ctx.strokeStyle = 'rgba(0,0,0,0.5)'
ctx.beginPath()
ctx.lineTo(50, 102)
ctx.lineTo(50 + text.width, 102)
ctx.stroke()

loadImage('examples/images/lime-cat.jpg').then((image) => {
  ctx.drawImage(image, 50, 0, 70, 70)

  console.log('<img src="' + canvas.toDataURL() + '" />')
})

Where are the canvas docs?

The canvas package documentation can be found on the Mozilla Web Canvas API link provided in the Readme and the Compatibility Status page for the current API compliance. All utility methods and non-standard APIs are documented in the Readme itself. For more detailed utilization and instructions, please refer to the wiki of the Github repository.