Skip to content

Commit

Permalink
docs(README): Document using canvas-prebuilt@2.x (#61)
Browse files Browse the repository at this point in the history
* docs(README): Document using canvas-prebuilt@2.x

* docs(README): Make package deprecation clearer
  • Loading branch information
delucis authored and chearon committed Oct 29, 2018
1 parent 349606d commit 73dbaf4
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
[![NPM version](https://badge.fury.io/js/canvas-prebuilt.svg)](http://badge.fury.io/js/canvas-prebuilt)

This is a drop-in replacement for canvas that does not require any compiling. To use it
just `npm install canvas-prebuilt` or replace `canvas` with `canvas-prebuilt` in your
dependencies.
**NOTE:** the `canvas-prebuilt` package is deprecated. As of version 2,
[`canvas`](https://github.com/Automattic/node-canvas) itself bundles prebuilt
versions from this repo. Install by running
```
npm install --save canvas
```
…and use `canvas` as usual.

# Using `canvas-prebuilt` (deprecated)

This is a drop-in replacement for `canvas` that does not require any compiling.
The repo is just a set of scripts that downloads a specific `node-canvas` version, builds it
and bundles it on all platforms. It's meant to run on Travis and AppVeyor but it can
be run locally too.

You will also need to change `require('canvas')` to `require('canvas-prebuilt')`.
If you still need to use prebuilt 1.x and 2-alpha versions of `canvas`,
run `npm install --save canvas-prebuilt`
or replace `canvas` with `canvas-prebuilt` in your dependencies.

The repo is just a set of scripts that downloads a specific node-canvas version, builds it
and bundles it on all platforms. It's meant to run on Travis and AppVeyor but it can
be run locally too
In your code, use `require('canvas-prebuilt')` wherever you would otherwise use `require('canvas')`.

# Linux technicalities

Expand Down

0 comments on commit 73dbaf4

Please sign in to comment.