{"name":"canvas","version":"2.0.0-alpha.18","keywords":["canvas","graphic","graphics","pixman","cairo","image","images","pdf"],"author":{"name":"TJ Holowaychuk","email":"tj@learnboost.com"},"license":"MIT","_id":"canvas@2.0.0-alpha.18","maintainers":[{"name":"domenic","email":"d@domenic.me"},{"name":"kangax","email":"kangax@gmail.com"},{"name":"linusu","email":"linus@folkdatorn.se"},{"name":"rauchg","email":"rauchg@gmail.com"},{"name":"tjholowaychuk","email":"tj@vision-media.ca"},{"name":"tootallnate","email":"nathan@tootallnate.net"}],"contributors":[{"name":"Nathan Rajlich","email":"nathan@tootallnate.net"},{"name":"Rod Vagg","email":"r@va.gg"},{"name":"Juriy Zaytsev","email":"kangax@gmail.com"}],"homepage":"https://github.com/Automattic/node-canvas","bugs":{"url":"https://github.com/Automattic/node-canvas/issues"},"dist":{"shasum":"7d895c085ec1e2e5f97125a12cd525895519eeb1","tarball":"http://registry-npm.ywwl.com/canvas/download/canvas-2.0.0-alpha.18.tgz","fileCount":60,"integrity":"sha512-fvuVZcj4QIULTVd1sj0/nKeiCURiwLyf0fYfdq9Au/W5OUIX/DZSa9IzgNBVxmuRwdRFZztBnt3PxL+GJfVP7A==","signatures":[{"sig":"MEYCIQCHocW/HqmWHRQy2y9ct+Jft/Rumr6+swdhY4tAcgK8kgIhAK/474OgjT2ogKFqZ+fsX4UCRXa+hzZLfSbdn8xY0JdI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":323504,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbvZvhCRA9TVsSAnZWagAAH+QP/0Wh1Pi/l9Sy7Mz+dCoB\n0yWeoOIB/Qfm5A4uSu1PB6GSzVaLmbPpGOyGlvdeGsdq0H8x8mzarPr9dTpq\nUgvVE3G+jJOpQ5LwwaH1SsudflxobQImQKFuqUmIr/zzrHcU+318EUaaTd8g\nzD3DyXPU8sKo21esMaH/ZR/q+NFicd8CLt3aPN6jrJZuijvl+noAz2bFh2UE\nOGTczG9+R5T9a94DsHwjPbFvLSblyd9loLm2pu7NTxQ4FkgyI71x1iu8RDsQ\ngSGminFOv6OomxdJ8bVFXn6G1CBde4vYy8et5SnyzyjArbZxu1a/T4EUDCU4\nolZoNgXOa0G1Ak4TZj155Z5P4iXNhsF0A0L3yPkfXNBn80FMRk01Naf+q/cz\nLSWDKVGbcfUvfMHtW93BEca0DOjn9liMFoLEgpNnmJRQ9cLE8SETaIgMMUuM\nO9N4NymVzKnfPiYySQckkZ3Gf2p8H7xbhrGDiAj5z2Y+BhwGozVRdm6qmKCH\nklhxmYfUufVlV63swnVLmS4Ln8sw4iQbyHGFHH3dDoCdfpivsXqQge3oMP5A\n1np+aNzBu0n5XOIFHMKb6wMlnQsSJpyLGvt9IDx8IdDJRRX/61cUCrMeQnka\nQwXxFGQE8nlW4IzB5vpa76z+6p3vE3SgtotBQWVaPD/SOa+JcZ2pXNwx5JEt\nQrR4\r\n=pLR/\r\n-----END PGP SIGNATURE-----\r\n","size":82910,"noattachment":false,"key":"/canvas/-/canvas-2.0.0-alpha.18.tgz"},"main":"index.js","binary":{"host":"https://github.com/node-gfx/node-canvas-prebuilt/releases/download/","module_name":"canvas-prebuilt","module_path":"build/Release","remote_path":"v{version}","package_name":"{module_name}-v{version}-{node_abi}-{platform}-{libc}-{arch}.tar.gz"},"readme":"# node-canvas\n\n-----\n\n## This is the documentation for version 2.0.0-alpha\nAlpha versions of 2.0 can be installed using `npm install canvas@next`.\n\nSee the [changelog](https://github.com/Automattic/node-canvas/blob/master/CHANGELOG.md)\nfor a guide to upgrading from 1.x to 2.x.\n\n**For version 1.x documentation, see [the v1.x branch](https://github.com/Automattic/node-canvas/tree/v1.x)**\n\n-----\n\n### Canvas graphics API backed by Cairo\n[![Build Status](https://travis-ci.org/Automattic/node-canvas.svg?branch=master)](https://travis-ci.org/Automattic/node-canvas)\n[![NPM version](https://badge.fury.io/js/canvas.svg)](http://badge.fury.io/js/canvas)\n\n  node-canvas is a [Cairo](http://cairographics.org/) backed Canvas implementation for [NodeJS](http://nodejs.org).\n\n## Authors\n\n  - TJ Holowaychuk ([tj](http://github.com/tj))\n  - Nathan Rajlich ([TooTallNate](http://github.com/TooTallNate))\n  - Rod Vagg ([rvagg](http://github.com/rvagg))\n  - Juriy Zaytsev ([kangax](http://github.com/kangax))\n\n## Installation\n\n```bash\n$ npm install canvas\n```\n\nBy default, binaries for macOS, Linux and Windows will be downloaded. If you want to build from source, use `npm install --build-from-source`.\n\nCurrently the minimum version of node required is __6.0.0__\n\n### Compiling\n\nIf you don't have a supported OS or processor architecture, or you use `--build-from-source`, the module will be compiled on your system. Unless previously installed you'll _need_ __Cairo__ and __Pango__. For system-specific installation view the [Wiki](https://github.com/Automattic/node-canvas/wiki/_pages).\n\nYou can quickly install the dependencies by using the command for your OS:\n\nOS | Command\n----- | -----\nOS X | Using [Homebrew](https://brew.sh/):<br/>`brew install pkg-config cairo pango libpng jpeg giflib`<br/><br/>Using [MacPorts](https://www.macports.org/):<br/>`port install pkgconfig cairo pango libpng jpeg giflib libsrvg`\nUbuntu | `sudo apt-get install libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++`\nFedora | `sudo yum install cairo cairo-devel cairomm-devel libjpeg-turbo-devel pango pango-devel pangomm pangomm-devel giflib-devel`\nSolaris | `pkgin install cairo pango pkg-config xproto renderproto kbproto xextproto`\nOpenBSD | `doas pkg_add cairo pango png jpeg giflib`\nWindows | [Instructions on our wiki](https://github.com/Automattic/node-canvas/wiki/Installation:-Windows)\n\n**Mac OS X v10.11+:** If you have recently updated to Mac OS X v10.11+ and are experiencing trouble when compiling, run the following command: `xcode-select --install`. Read more about the problem [on Stack Overflow](http://stackoverflow.com/a/32929012/148072).\n\n## Screencasts\n\n  - [Introduction](http://screenr.com/CTk)\n\n## Example\n\n```javascript\nconst { createCanvas, loadImage } = require('canvas')\nconst canvas = createCanvas(200, 200)\nconst ctx = canvas.getContext('2d')\n\n// Write \"Awesome!\"\nctx.font = '30px Impact'\nctx.rotate(0.1)\nctx.fillText('Awesome!', 50, 100)\n\n// Draw line under text\nvar text = ctx.measureText('Awesome!')\nctx.strokeStyle = 'rgba(0,0,0,0.5)'\nctx.beginPath()\nctx.lineTo(50, 102)\nctx.lineTo(50 + text.width, 102)\nctx.stroke()\n\n// Draw cat with lime helmet\nloadImage('examples/images/lime-cat.jpg').then((image) => {\n  ctx.drawImage(image, 50, 0, 70, 70)\n\n  console.log('<img src=\"' + canvas.toDataURL() + '\" />')\n})\n```\n\n## Know issues\n\n- CMYK images are not supported ([#1183](https://github.com/Automattic/node-canvas/issues/1183), [#425](https://github.com/Automattic/node-canvas/issues/425))\n- `ctx.fillText` `maxWidth` is inconsistent ([#1088](https://github.com/Automattic/node-canvas/issues/1183), [#1088](https://github.com/Automattic/node-canvas/issues/425))\n- Async `canvas.toBuffer` for PDF is not working ([#821](https://github.com/Automattic/node-canvas/issues/821))\n\n[See all list of bugs](https://github.com/Automattic/node-canvas/issues?q=is%3Aissue+is%3Aopen+label%3ABug).\n\n## Non-Standard APIs\n\nnode-canvas implements the [HTML Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API) as closely as possible.\n(See [Compatibility Status](https://github.com/Automattic/node-canvas/wiki/Compatibility-Status)\nfor the current API compliance.) All non-standard APIs are documented below.\n\n### Image#src\n\nAs in browsers, `img.src` can be set to a `data:` URI or a remote URL. In addition,\nnode-canvas allows setting `src` to a local file path or to a `Buffer` instance.\n\n```javascript\nconst { Image } = require('canvas');\n\n// From a buffer:\nfs.readFile('images/squid.png', (err, squid) => {\n  if (err) throw err\n  const img = new Image()\n  img.onload = () => ctx.drawImage(img, 0, 0)\n  img.onerror = err => { throw err }\n  img.src = squid\n})\n\n// From a local file path:\nconst img = new Image()\nimg.onload = () => ctx.drawImage(img, 0, 0)\nimg.onerror = err => { throw err }\nimg.src = 'images/squid.png'\n\n// From a remote URL:\nimg.src = 'http://picsum.photos/200/300'\n// ... as above\n\n// From a `data:` URI:\nimg.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='\n// ... as above\n```\n\n*Note: In some cases, `img.src=` is currently synchronous. However, you should\nalways use `img.onload` and `img.onerror`, as we intend to make `img.src=` always\nasynchronous as it is in browsers. See https://github.com/Automattic/node-canvas/issues/1007.*\n\n### Image#dataMode\n\nnode-canvas adds `Image#dataMode` support, which can be used to opt-in to mime data tracking of images (currently only JPEGs).\n\nWhen mime data is tracked, in PDF mode JPEGs can be embedded directly into the output, rather than being re-encoded into PNG. This can drastically reduce filesize, and speed up rendering.\n\n```javascript\nconst { Image } = require('canvas');\nvar img = new Image();\nimg.dataMode = Image.MODE_IMAGE; // Only image data tracked\nimg.dataMode = Image.MODE_MIME; // Only mime data tracked\nimg.dataMode = Image.MODE_MIME | Image.MODE_IMAGE; // Both are tracked\n```\n\nIf image data is not tracked, and the Image is drawn to an image rather than a PDF canvas, the output will be junk. Enabling mime data tracking has no benefits (only a slow down) unless you are generating a PDF.\n\n### Canvas#toBuffer()\n\nCreates a [`Buffer`](https://nodejs.org/api/buffer.html) object representing the\nimage contained in the canvas.\n\n> `canvas.toBuffer((err: Error|null, result: Buffer) => void[, mimeType[, config]]) => void`\n> `canvas.toBuffer([mimeType[, config]]) => Buffer`\n\n* **callback** If provided, the buffer will be provided in the callback instead\n  of being returned by the function. Invoked with an error as the first argument\n  if encoding failed, or the resulting buffer as the second argument if it\n  succeeded. Not supported for mimeType `raw` or for PDF or SVG canvases (there\n  is no async work to do in those cases).\n* **mimeType** A string indicating the image format. Valid options are `image/png`,\n  `image/jpeg` (if node-canvas was built with JPEG support) and `raw` (unencoded\n  ARGB32 data in native-endian byte order, top-to-bottom). Defaults to\n  `image/png`. If the canvas is a PDF or SVG canvas, this argument is ignored\n  and a PDF or SVG is returned always.\n* **config**\n  * For `image/jpeg` an object specifying the quality (0 to 1), if progressive\n    compression should be used and/or if chroma subsampling should be used:\n    `{quality: 0.75, progressive: false, chromaSubsampling: true}`. All\n    properties are optional.\n  * For `image/png`, an object specifying the ZLIB compression level (between 0\n    and 9), the compression filter(s), the palette (indexed PNGs only), the\n    the background palette index (indexed PNGs only) and/or the resolution (ppi):\n    `{compressionLevel: 6, filters: canvas.PNG_ALL_FILTERS, palette: undefined, backgroundIndex: 0, resolution: undefined}`.\n    All properties are optional.\n\n    Note that the PNG format encodes the resolution in pixels per meter, so if\n    you specify `96`, the file will encode 3780 ppm (~96.01 ppi). The resolution\n    is undefined by default to match common browser behavior.\n\n**Return value**\n\nIf no callback is provided, a [`Buffer`](https://nodejs.org/api/buffer.html).\nIf a callback is provided, none.\n\n#### Examples\n\n```javascript\n// Default: buf contains a PNG-encoded image\nconst buf = canvas.toBuffer()\n\n// PNG-encoded, zlib compression level 3 for faster compression but bigger files, no filtering\nconst buf2 = canvas.toBuffer('image/png', {compressionLevel: 3, filters: canvas.PNG_FILTER_NONE})\n\n// JPEG-encoded, 50% quality\nconst buf3 = canvas.toBuffer('image/jpeg', {quality: 0.5})\n\n// Asynchronous PNG\ncanvas.toBuffer((err, buf) => {\n  if (err) throw err; // encoding failed\n  // buf is PNG-encoded image\n})\n\ncanvas.toBuffer((err, buf) => {\n  if (err) throw err; // encoding failed\n  // buf is JPEG-encoded image at 95% quality\n}, 'image/jpeg', {quality: 0.95})\n\n// ARGB32 pixel values, native-endian\nconst buf4 = canvas.toBuffer('raw')\nconst {stride, width} = canvas\n// In memory, this is `canvas.height * canvas.stride` bytes long.\n// The top row of pixels, in ARGB order, left-to-right, is:\nconst topPixelsARGBLeftToRight = buf4.slice(0, width * 4)\n// And the third row is:\nconst row3 = buf4.slice(2 * stride, 2 * stride + width * 4)\n\n// SVG and PDF canvases ignore the mimeType argument\nconst myCanvas = createCanvas(w, h, 'pdf')\nmyCanvas.toBuffer() // returns a buffer containing a PDF-encoded canvas\n```\n\n### Canvas#createPNGStream(options)\n\nCreates a [`ReadableStream`](https://nodejs.org/api/stream.html#stream_class_stream_readable)\nthat emits PNG-encoded data.\n\n> `canvas.createPNGStream([config]) => ReadableStream`\n\n* `config` An object specifying the ZLIB compression level (between 0 and 9),\n  the compression filter(s), the palette (indexed PNGs only) and/or the\n  background palette index (indexed PNGs only):\n  `{compressionLevel: 6, filters: canvas.PNG_ALL_FILTERS, palette: undefined, backgroundIndex: 0, resolution: undefined}`.\n  All properties are optional.\n\n#### Examples\n\n```javascript\nconst fs = require('fs')\nconst out = fs.createWriteStream(__dirname + '/test.png')\nconst stream = canvas.createPNGStream()\nstream.pipe(out)\nout.on('finish', () =>  console.log('The PNG file was created.'))\n```\n\nTo encode indexed PNGs from canvases with `pixelFormat: 'A8'` or `'A1'`, provide an options object:\n\n```js\nconst palette = new Uint8ClampedArray([\n  //r    g    b    a\n    0,  50,  50, 255, // index 1\n   10,  90,  90, 255, // index 2\n  127, 127, 255, 255\n  // ...\n])\ncanvas.createPNGStream({\n  palette: palette,\n  backgroundIndex: 0 // optional, defaults to 0\n})\n```\n\n### Canvas#createJPEGStream()\n\nCreates a [`createJPEGStream`](https://nodejs.org/api/stream.html#stream_class_stream_readable)\nthat emits JPEG-encoded data.\n\n_Note: At the moment, `createJPEGStream()` is synchronous under the hood. That is, it\nruns in the main thread, not in the libuv threadpool._\n\n> `canvas.createJPEGStream([config]) => ReadableStream`\n\n* `config` an object specifying the quality (0 to 1), if progressive compression\n  should be used and/or if chroma subsampling should be used:\n  `{quality: 0.75, progressive: false, chromaSubsampling: true}`. All properties\n  are optional.\n\n#### Examples\n\n```javascript\nconst fs = require('fs')\nconst out = fs.createWriteStream(__dirname + '/test.jpeg')\nconst stream = canvas.createJPEGStream()\nstream.pipe(out)\nout.on('finish', () =>  console.log('The JPEG file was created.'))\n\n// Disable 2x2 chromaSubsampling for deeper colors and use a higher quality\nconst stream = canvas.createJPEGStream({\n  quality: 95,\n  chromaSubsampling: false\n})\n```\n\n### Canvas#toDataURL() sync and async\n\nThe following syntax patterns are supported:\n\n```javascript\nvar dataUrl = canvas.toDataURL(); // defaults to PNG\nvar dataUrl = canvas.toDataURL('image/png');\ncanvas.toDataURL(function(err, png){ }); // defaults to PNG\ncanvas.toDataURL('image/png', function(err, png){ });\ncanvas.toDataURL('image/jpeg', function(err, jpeg){ }); // sync JPEG is not supported\ncanvas.toDataURL('image/jpeg', {opts...}, function(err, jpeg){ }); // see Canvas#createJPEGStream for valid options\ncanvas.toDataURL('image/jpeg', quality, function(err, jpeg){ }); // spec-following; quality from 0 to 1\n```\n\n### `registerFont` for bundled fonts\n\nIt can be useful to use a custom font file if you are distributing code that uses node-canvas and a specific font. Or perhaps you are using it to do automated tests and you want the renderings to be the same across operating systems regardless of what fonts are installed.\n\nTo do that, you should use `registerFont()`.\n\n**You need to call it before the Canvas is created**\n\n```javascript\nconst { registerFont, createCanvas } = require('canvas');\nregisterFont('comicsans.ttf', {family: 'Comic Sans'});\n\nvar canvas = createCanvas(500, 500),\n  ctx = canvas.getContext('2d');\n\nctx.font = '12px \"Comic Sans\"';\nctx.fillText('Everyone hates this font :(', 250, 10);\n```\n\nThe second argument is an object with properties that resemble the CSS properties that are specified in `@font-face` rules. You must specify at least `family`. `weight`, and `style` are optional (and default to \"normal\").\n\n### CanvasRenderingContext2D#patternQuality\n\nGiven one of the values below will alter pattern (gradients, images, etc) render quality, defaults to _good_.\n\n  - fast\n  - good\n  - best\n  - nearest\n  - bilinear\n\n### CanvasRenderingContext2D#textDrawingMode\n\nCan be either `path` or `glyph`. Using `glyph` is much faster than `path` for drawing, and when using a PDF context will embed the text natively, so will be selectable and lower filesize. The downside is that cairo does not have any subpixel precision for `glyph`, so this will be noticeably lower quality for text positioning in cases such as rotated text. Also, strokeText in `glyph` will act the same as fillText, except using the stroke style for the fill.\n\nDefaults to _path_.\n\nThis property is tracked as part of the canvas state in save/restore.\n\n### CanvasRenderingContext2D#filter\n\nLike `patternQuality`, but applies to transformations effecting more than just patterns. Defaults to _good_.\n\n  - fast\n  - good\n  - best\n  - nearest\n  - bilinear\n\n### Global Composite Operations\n\nIn addition to those specified and commonly implemented by browsers, the following have been added:\n\n  - multiply\n  - screen\n  - overlay\n  - hard-light\n  - soft-light\n  - hsl-hue\n  - hsl-saturation\n  - hsl-color\n  - hsl-luminosity\n\n## Anti-Aliasing\n\n Set anti-aliasing mode\n\n - default\n - none\n - gray\n - subpixel\n\n For example:\n\n```javascript\nctx.antialias = 'none';\n```\n\n## PDF Support\n\n  Basic PDF support was added in 0.11.0. If you are building cairo from source, be sure to use `--enable-pdf=yes` for the PDF backend.\n  node-canvas must know that it is creating a PDF on initialization, using the \"pdf\" string:\n\n```js\nvar canvas = createCanvas(200, 500, 'pdf');\n```\n\n An additional method `.addPage()` is then available to create\n multiple page PDFs:\n\n```js\nctx.font = '22px Helvetica';\nctx.fillText('Hello World', 50, 80);\nctx.addPage();\n\nctx.font = '22px Helvetica';\nctx.fillText('Hello World 2', 50, 80);\nctx.addPage();\n\nctx.font = '22px Helvetica';\nctx.fillText('Hello World 3', 50, 80);\nctx.addPage();\n```\n\n## SVG Support\n\n Just like PDF support, make sure to install cairo with `--enable-svg=yes`.\n You also need to tell node-canvas that it is working on SVG upon its initialization:\n\n```js\nvar canvas = createCanvas(200, 500, 'svg');\n// Use the normal primitives.\nfs.writeFileSync('out.svg', canvas.toBuffer());\n```\n\n## SVG Image Support\n\nIf librsvg is available when node-canvas is installed, node-canvas can render\nSVG images to your canvas context. This currently works by rasterizing the SVG\nimage (i.e. drawing an SVG image to an SVG canvas will not preserve the SVG data).\n\n```js\nconst img = new Image()\nimg.onload = () => ctx.drawImage(img, 0, 0)\nimg.onerror = err => { throw err }\nimg.src = './example.svg'\n```\n\n## Image pixel formats (experimental)\n\nnode-canvas has experimental support for additional pixel formats, roughly\nfollowing the [Canvas color space proposal](https://github.com/WICG/canvas-color-space/blob/master/CanvasColorSpaceProposal.md).\n\n```js\nvar canvas = createCanvas(200, 200);\nvar ctx = canvas.getContext('2d', {pixelFormat: 'A8'});\n```\n\nBy default, canvases are created in the `RGBA32` format, which corresponds to\nthe native HTML Canvas behavior. Each pixel is 32 bits. The JavaScript APIs\nthat involve pixel data (`getImageData`, `putImageData`) store the colors in\nthe order {red, green, blue, alpha} without alpha pre-multiplication. (The C++\nAPI stores the colors in the order {alpha, red, green, blue} in native-[endian](https://en.wikipedia.org/wiki/Endianness)\nordering, with alpha pre-multiplication.)\n\nThese additional pixel formats have experimental support:\n\n* `RGB24` Like `RGBA32`, but the 8 alpha bits are always opaque. This format is\n  always used if the `alpha` context attribute is set to false (i.e.\n  `canvas.getContext('2d', {alpha: false})`). This format can be faster than\n  `RGBA32` because transparency does not need to be calculated.\n* `A8` Each pixel is 8 bits. This format can either be used for creating\n  grayscale images (treating each byte as an alpha value), or for creating\n  indexed PNGs (treating each byte as a palette index) (see [the example using\n  alpha values with `fillStyle`](examples/indexed-png-alpha.js) and [the\n  example using `imageData`](examples/indexed-png-image-data.js)).\n* `RGB16_565` Each pixel is 16 bits, with red in the upper 5 bits, green in the\n  middle 6 bits, and blue in the lower 5 bits, in native platform endianness.\n  Some hardware devices and frame buffers use this format. Note that PNG does\n  not support this format; when creating a PNG, the image will be converted to\n  24-bit RGB. This format is thus suboptimal for generating PNGs.\n  `ImageData` instances for this mode use a `Uint16Array` instead of a `Uint8ClampedArray`.\n* `A1` Each pixel is 1 bit, and pixels are packed together into 32-bit\n  quantities. The ordering of the bits matches the endianness of the\n  platform: on a little-endian machine, the first pixel is the least-\n  significant bit. This format can be used for creating single-color images.\n  *Support for this format is incomplete, see note below.*\n* `RGB30` Each pixel is 30 bits, with red in the upper 10, green\n  in the middle 10, and blue in the lower 10. (Requires Cairo 1.12 or later.)\n  *Support for this format is incomplete, see note below.*\n\nNotes and caveats:\n\n* Using a non-default format can affect the behavior of APIs that involve pixel\n  data:\n\n  * `context2d.createImageData` The size of the array returned depends on the\n    number of bit per pixel for the underlying image data format, per the above\n    descriptions.\n  * `context2d.getImageData` The format of the array returned depends on the\n    underlying image mode, per the above descriptions. Be aware of platform\n    endianness, which can be determined using node.js's [`os.endianness()`](https://nodejs.org/api/os.html#os_os_endianness)\n    function.\n  * `context2d.putImageData` As above.\n\n* `A1` and `RGB30` do not yet support `getImageData` or `putImageData`. Have a\n  use case and/or opinion on working with these formats? Open an issue and let\n  us know! (See #935.)\n\n* `A1`, `A8`, `RGB30` and `RGB16_565` with shadow blurs may crash or not render\n  properly.\n\n* The `ImageData(width, height)` and `ImageData(Uint8ClampedArray, width)`\n  constructors assume 4 bytes per pixel. To create an `ImageData` instance with\n  a different number of bytes per pixel, use\n  `new ImageData(new Uint8ClampedArray(size), width, height)` or\n  `new ImageData(new Uint16ClampedArray(size), width, height)`.\n\n## Benchmarks\n\n Although node-canvas is extremely new, and we have not even begun optimization yet it is already quite fast. For benchmarks vs other node canvas implementations view this [gist](https://gist.github.com/664922), or update the submodules and run `$ make benchmark` yourself.\n\n## Contribute\n\n Want to contribute to node-canvas? patches for features, bug fixes, documentation, examples and others are certainly welcome. Take a look at the [issue queue](https://github.com/Automattic/node-canvas/issues) for existing issues.\n\n## Examples\n\n Examples are placed in _./examples_, be sure to check them out! most produce a png image of the same name, and others such as _live-clock.js_ launch an http server to be viewed in the browser.\n\n## Documentation\n\nThis project is an implementation of the Web Canvas API. For API documentation, please visit: [Mozilla Web Canvas API](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API)\n\n## Testing\n\nIf you have not previously, init git submodules:\n\n    $ git submodule update --init\n\nInstall the node modules:\n\n    $ npm install\n\nBuild node-canvas:\n\n    $ node-gyp rebuild\n\nUnit tests:\n\n    $ make test\n\nVisual tests:\n\n    $ make test-server\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2010 LearnBoost, and contributors &lt;dev@learnboost.com&gt;\n\nCopyright (c) 2014 Automattic, Inc and contributors &lt;dev@automattic.com&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","browser":"browser.js","engines":{"node":">=6"},"gitHead":"586b395afb4a7bd5515b28d255118debceb2d139","scripts":{"test":"mocha test/*.test.js","install":"node-pre-gyp install --fallback-to-build","pretest":"standard examples/*.js test/server.js test/public/*.js benchmark/run.js util/has_lib.js browser.js index.js && node-gyp build","benchmark":"node benchmarks/run.js","test-server":"node test/server.js","prebenchmark":"node-gyp build","pretest-server":"node-gyp build"},"_npmUser":{"name":"linusu","email":"linus@folkdatorn.se"},"repository":{"url":"git://github.com/Automattic/node-canvas.git","type":"git"},"_npmVersion":"6.4.1","description":"Canvas graphics API backed by Cairo","directories":{},"_nodeVersion":"10.11.0","dependencies":{"nan":"^2.11.1","node-pre-gyp":"^0.11.0"},"_hasShrinkwrap":false,"readmeFilename":"Readme.md","devDependencies":{"mocha":"^5.2.0","express":"^4.16.3","standard":"^12.0.1","assert-rejects":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/canvas_2.0.0-alpha.18_1539152864519_0.2284398972403756","host":"s3://npm-registry-packages"},"publish_time":1539152864699,"_cnpm_publish_time":1539152864699,"dist-tags":{"latest":"3.2.3","next":"4.0.0-rc3","test":"3.0.0-rc1e"}}