Skip to content

Instantly share code, notes, and snippets.

@Couto

Couto/README.md Secret

Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Couto/e47c7aff573f0108392b to your computer and use it in GitHub Desktop.
Save Couto/e47c7aff573f0108392b to your computer and use it in GitHub Desktop.
Dev environment for lovell/sharp, where an error happens everytime I try to install on ubuntu trusty

Please download the related image by clicking this link I tried to push the image as a gist file, but github doesn't allow files that big.

var sharp = require('sharp'),
imgIn = 'snoop-dogg-uncompressed.tif',
imgOut = 'snoop-dogg-uncompressed-sharp.jpg';
sharp(imgIn).write(imgOut, function (err) {
if (err) { throw err; }
console.log('Saved');
});
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install' ]
2 info using npm@1.4.9
3 info using node@v0.10.28
4 verbose node symlink /usr/bin/node
5 warn package.json sharp-debug@0.0.0 No repository field.
6 verbose readDependencies using package.json deps
7 verbose install where, deps [ '/vagrant', [ 'sharp' ] ]
8 info preinstall sharp-debug@0.0.0
9 verbose readDependencies using package.json deps
10 verbose cache add [ 'sharp@^0.4.0', null ]
11 verbose cache add name=undefined spec="sharp@^0.4.0" args=["sharp@^0.4.0",null]
12 verbose parsed url { protocol: null,
12 verbose parsed url slashes: null,
12 verbose parsed url auth: null,
12 verbose parsed url host: null,
12 verbose parsed url port: null,
12 verbose parsed url hostname: null,
12 verbose parsed url hash: null,
12 verbose parsed url search: null,
12 verbose parsed url query: null,
12 verbose parsed url pathname: 'sharp@^0.4.0',
12 verbose parsed url path: 'sharp@^0.4.0',
12 verbose parsed url href: 'sharp@^0.4.0' }
13 verbose cache add name="sharp" spec="^0.4.0" args=["sharp","^0.4.0"]
14 verbose parsed url { protocol: null,
14 verbose parsed url slashes: null,
14 verbose parsed url auth: null,
14 verbose parsed url host: null,
14 verbose parsed url port: null,
14 verbose parsed url hostname: null,
14 verbose parsed url hash: null,
14 verbose parsed url search: null,
14 verbose parsed url query: null,
14 verbose parsed url pathname: '^0.4.0',
14 verbose parsed url path: '^0.4.0',
14 verbose parsed url href: '^0.4.0' }
15 verbose addNamed [ 'sharp', '^0.4.0' ]
16 verbose addNamed [ null, '>=0.4.0-0 <0.5.0-0' ]
17 silly lockFile bc641a61-sharp-0-4-0 sharp@^0.4.0
18 verbose lock sharp@^0.4.0 /home/vagrant/.npm/bc641a61-sharp-0-4-0.lock
19 silly addNameRange { name: 'sharp', range: '>=0.4.0-0 <0.5.0-0', hasData: false }
20 verbose url raw sharp
21 verbose url resolving [ 'https://registry.npmjs.org/', './sharp' ]
22 verbose url resolved https://registry.npmjs.org/sharp
23 info trying registry request attempt 1 at 16:20:07
24 http GET https://registry.npmjs.org/sharp
25 http 200 https://registry.npmjs.org/sharp
26 silly registry.get cb [ 200,
26 silly registry.get { date: 'Wed, 21 May 2014 16:20:13 GMT',
26 silly registry.get server: 'CouchDB/1.5.0 (Erlang OTP/R16B)',
26 silly registry.get etag: '"1M3KYVR1SNIX9ILIMR47TQQJW"',
26 silly registry.get 'content-type': 'application/json',
26 silly registry.get via: '1.1 varnish',
26 silly registry.get 'cache-control': 'max-age=1',
26 silly registry.get 'content-length': '35535',
26 silly registry.get 'accept-ranges': 'bytes',
26 silly registry.get age: '3363',
26 silly registry.get 'x-served-by': 'cache-v37-ASH, cache-lcy1129-LCY',
26 silly registry.get 'x-cache': 'MISS, MISS',
26 silly registry.get 'x-cache-hits': '0, 0',
26 silly registry.get 'x-timer': 'S1400685850.518397331,VS0,VS42,VE51,VE3362689',
26 silly registry.get vary: 'Accept',
26 silly registry.get 'keep-alive': 'timeout=10, max=50',
26 silly registry.get connection: 'Keep-Alive' } ]
27 silly addNameRange number 2 { name: 'sharp', range: '>=0.4.0-0 <0.5.0-0', hasData: true }
28 silly addNameRange versions [ 'sharp',
28 silly addNameRange [ '0.0.1',
28 silly addNameRange '0.0.2',
28 silly addNameRange '0.0.3',
28 silly addNameRange '0.0.4',
28 silly addNameRange '0.0.5',
28 silly addNameRange '0.0.6',
28 silly addNameRange '0.0.7',
28 silly addNameRange '0.0.8',
28 silly addNameRange '0.0.9',
28 silly addNameRange '0.1.0',
28 silly addNameRange '0.1.1',
28 silly addNameRange '0.1.2',
28 silly addNameRange '0.1.3',
28 silly addNameRange '0.1.4',
28 silly addNameRange '0.1.5',
28 silly addNameRange '0.1.6',
28 silly addNameRange '0.1.7',
28 silly addNameRange '0.1.8',
28 silly addNameRange '0.2.0',
28 silly addNameRange '0.3.0',
28 silly addNameRange '0.4.0' ] ]
29 verbose addNamed [ 'sharp', '0.4.0' ]
30 verbose addNamed [ '0.4.0', '0.4.0' ]
31 silly lockFile 947d8a4f-sharp-0-4-0 sharp@0.4.0
32 verbose lock sharp@0.4.0 /home/vagrant/.npm/947d8a4f-sharp-0-4-0.lock
33 silly lockFile d03abd06--npmjs-org-sharp-sharp-0-4-0-tgz https://registry.npmjs.org/sharp/-/sharp-0.4.0.tgz
34 verbose lock https://registry.npmjs.org/sharp/-/sharp-0.4.0.tgz /home/vagrant/.npm/d03abd06--npmjs-org-sharp-sharp-0-4-0-tgz.lock
35 verbose addRemoteTarball [ 'https://registry.npmjs.org/sharp/-/sharp-0.4.0.tgz',
35 verbose addRemoteTarball 'c34b79f1eaff8f4969d4817fbba0844dc8e73a62' ]
36 info retry fetch attempt 1 at 16:20:13
37 verbose fetch to= /home/vagrant/tmp/npm-14485-9uE7MOP7/1400689213457-0.619675231166184/tmp.tgz
38 http GET https://registry.npmjs.org/sharp/-/sharp-0.4.0.tgz
39 http 200 https://registry.npmjs.org/sharp/-/sharp-0.4.0.tgz
40 verbose tar unpack /home/vagrant/tmp/npm-14485-9uE7MOP7/1400689213457-0.619675231166184/tmp.tgz
41 silly lockFile 0c453493--vagrant-npm-sharp-0-4-0-package tar:///home/vagrant/.npm/sharp/0.4.0/package
42 verbose lock tar:///home/vagrant/.npm/sharp/0.4.0/package /home/vagrant/.npm/0c453493--vagrant-npm-sharp-0-4-0-package.lock
43 silly lockFile 604f4228-213457-0-619675231166184-tmp-tgz tar:///home/vagrant/tmp/npm-14485-9uE7MOP7/1400689213457-0.619675231166184/tmp.tgz
44 verbose lock tar:///home/vagrant/tmp/npm-14485-9uE7MOP7/1400689213457-0.619675231166184/tmp.tgz /home/vagrant/.npm/604f4228-213457-0-619675231166184-tmp-tgz.lock
45 silly gunzTarPerm modes [ '755', '644' ]
46 silly gunzTarPerm extractEntry package.json
47 silly gunzTarPerm extractEntry .npmignore
48 silly gunzTarPerm extractEntry README.md
49 silly gunzTarPerm extractEntry LICENSE
50 silly gunzTarPerm extractEntry index.js
51 silly gunzTarPerm extractEntry binding.gyp
52 silly gunzTarPerm extractEntry src/sharp.cc
53 silly lockFile 0c453493--vagrant-npm-sharp-0-4-0-package tar:///home/vagrant/.npm/sharp/0.4.0/package
54 silly lockFile 0c453493--vagrant-npm-sharp-0-4-0-package tar:///home/vagrant/.npm/sharp/0.4.0/package
55 silly lockFile 604f4228-213457-0-619675231166184-tmp-tgz tar:///home/vagrant/tmp/npm-14485-9uE7MOP7/1400689213457-0.619675231166184/tmp.tgz
56 silly lockFile 604f4228-213457-0-619675231166184-tmp-tgz tar:///home/vagrant/tmp/npm-14485-9uE7MOP7/1400689213457-0.619675231166184/tmp.tgz
57 silly lockFile d03abd06--npmjs-org-sharp-sharp-0-4-0-tgz https://registry.npmjs.org/sharp/-/sharp-0.4.0.tgz
58 silly lockFile d03abd06--npmjs-org-sharp-sharp-0-4-0-tgz https://registry.npmjs.org/sharp/-/sharp-0.4.0.tgz
59 silly lockFile 947d8a4f-sharp-0-4-0 sharp@0.4.0
60 silly lockFile 947d8a4f-sharp-0-4-0 sharp@0.4.0
61 silly lockFile bc641a61-sharp-0-4-0 sharp@^0.4.0
62 silly lockFile bc641a61-sharp-0-4-0 sharp@^0.4.0
63 silly resolved [ { name: 'sharp',
63 silly resolved version: '0.4.0',
63 silly resolved author: { name: 'Lovell Fuller', email: 'npm@lovell.info' },
63 silly resolved contributors: [ [Object] ],
63 silly resolved description: 'High performance Node.js module to resize JPEG, PNG and WebP images using the libvips library',
63 silly resolved scripts:
63 silly resolved { test: 'node tests/unit && node tests/perf',
63 silly resolved install: 'node-gyp rebuild' },
63 silly resolved main: 'index.js',
63 silly resolved repository: { type: 'git', url: 'git://github.com/lovell/sharp' },
63 silly resolved keywords:
63 silly resolved [ 'jpeg',
63 silly resolved 'png',
63 silly resolved 'webp',
63 silly resolved 'tiff',
63 silly resolved 'gif',
63 silly resolved 'resize',
63 silly resolved 'thumbnail',
63 silly resolved 'sharpen',
63 silly resolved 'crop',
63 silly resolved 'embed',
63 silly resolved 'libvips',
63 silly resolved 'vips',
63 silly resolved 'fast',
63 silly resolved 'buffer' ],
63 silly resolved dependencies: { nan: '^1.0.0' },
63 silly resolved devDependencies:
63 silly resolved { imagemagick: '^0.1.3',
63 silly resolved 'imagemagick-native': 'git://github.com/mash/node-imagemagick-native.git#master',
63 silly resolved gm: '^1.16.0',
63 silly resolved async: '^0.8.0',
63 silly resolved benchmark: '^1.0.0' },
63 silly resolved license: 'Apache 2.0',
63 silly resolved engines: { node: '>=0.10' },
63 silly resolved gypfile: true,
63 silly resolved readme: '# sharp\n\n* [Installation](https://github.com/lovell/sharp#installation)\n* [Usage examples](https://github.com/lovell/sharp#usage-examples)\n* [API](https://github.com/lovell/sharp#api)\n* [Testing](https://github.com/lovell/sharp#testing)\n* [Performance](https://github.com/lovell/sharp#performance)\n* [Licence](https://github.com/lovell/sharp#licence)\n\nThe typical use case for this high speed Node.js module is to convert large images of many formats to smaller, web-friendly JPEG, PNG and WebP images of varying dimensions.\n\nThe performance of JPEG resizing is typically 8x faster than ImageMagick and GraphicsMagick, based mainly on the number of CPU cores available. Everything remains non-blocking thanks to _libuv_.\n\nThis module supports reading and writing images of JPEG, PNG and WebP to and from both Buffer objects and the filesystem. It also supports reading images of many other types from the filesystem via libmagick++ or libgraphicsmagick++ if present.\n\nWhen generating JPEG output all metadata is removed and Huffman tables optimised without having to use separate command line tools like [jpegoptim](https://github.com/tjko/jpegoptim) and [jpegtran](http://jpegclub.org/jpegtran/).\n\nAnyone who has used the Node.js bindings for [GraphicsMagick](https://github.com/aheckmann/gm) will find the API similarly fluent.\n\nThis module is powered by the blazingly fast [libvips](https://github.com/jcupitt/libvips) image processing library, originally created in 1989 at Birkbeck College and currently maintained by John Cupitt.\n\n## Installation\n\n\tnpm install sharp\n\n### Prerequisites\n\n* Node.js v0.10+\n* [libvips](https://github.com/jcupitt/libvips) v7.38.5+\n\n_libvips_ will take advantage of [liborc](http://code.entropywave.com/orc/) if present, however versions of _liborc_ prior to 0.4.19 suffer memory leaks.\n\n### Install libvips on Mac OS\n\n\tbrew install homebrew/science/vips --with-webp --with-graphicsmagick\n\nThe _gettext_ dependency of _libvips_ [can lead](https://github.com/lovell/sharp/issues/9) to a `library not found for -lintl` error. If so, please try:\n\n\tbrew link gettext --force\n\n### Install libvips on Ubuntu Linux\n\n#### Ubuntu 14.x\n\n\tsudo apt-get install libvips-dev\n\n#### Ubuntu 13.x\n\nCompiling from source is recommended:\n\n\tsudo apt-get install automake build-essential git gobject-introspection gtk-doc-tools libfftw3-dev libglib2.0-dev libjpeg-turbo8-dev libpng12-dev libwebp-dev libtiff5-dev libxml2-dev swig\n\tgit clone https://github.com/jcupitt/libvips.git\n\tcd libvips\n\tgit checkout 7.38\n\t./bootstrap.sh\n\t./configure --enable-debug=no --enable-cxx=no --without-python --without-orc\n\tmake\n\tsudo make install\n\tsudo ldconfig\n\n#### Ubuntu 12.x\n\nRequires `libtiff4-dev` instead of `libtiff5-dev` and has [a bug](https://bugs.launchpad.net/ubuntu/+source/libwebp/+bug/1108731) in the libwebp package. Work around these problems by running these command first:\n\n\tsudo add-apt-repository ppa:lyrasis/precise-backports\n\tsudo apt-get update\n\tsudo apt-get install libtiff4-dev\n\nThen follow Ubuntu 13.x instructions.\n\n## Usage examples\n\n```javascript\nvar sharp = require(\'sharp\');\n```\n\n```javascript\nsharp(\'input.jpg\').resize(300, 200).write(\'output.jpg\', function(err) {\n if (err) {\n throw err;\n }\n // output.jpg is a 300 pixels wide and 200 pixels high image\n // containing a scaled and cropped version of input.jpg\n});\n```\n\n```javascript\nsharp(\'input.jpg\').resize(null, 200).progressive().toBuffer(function(err, outputBuffer) {\n if (err) {\n throw err;\n }\n // outputBuffer contains progressive JPEG image data, 200 pixels high\n});\n```\n\n```javascript\nsharp(\'input.png\').resize(300).sharpen().quality(90).webp(function(err, outputBuffer) {\n if (err) {\n throw err;\n }\n // outputBuffer contains 300 pixels wide, sharpened, 90% quality WebP image data\n});\n```\n\n```javascript\nsharp(inputBuffer).resize(200, 300).embedWhite().write(\'output.tiff\', function(err) {\n if (err) {\n throw err;\n }\n // output.tiff is a 200 pixels wide and 300 pixels high image containing a scaled\n // version, embedded on a white canvas, of the image data in buffer\n});\n```\n\n```javascript\nsharp(\'input.gif\').resize(200, 300).embedBlack().webp(function(err, outputBuffer) {\n if (err) {\n throw err;\n }\n // outputBuffer contains WebP image data of a 200 pixels wide and 300 pixels high\n // containing a scaled version, embedded on a black canvas, of input.gif\n});\n```\n\n```javascript\nsharp(inputBuffer).resize(200, 200).max().jpeg(function(err, outputBuffer) {\n if (err) {\n throw err;\n }\n // outputBuffer contains JPEG image data no wider than 200 pixels and no higher\n // than 200 pixels regardless of the inputBuffer image dimensions\n});\n```\n\n## API\n\n### sharp(input)\n\nConstructor to which further methods are chained. `input` can be one of:\n\n* Buffer containing JPEG, PNG or WebP image data, or\n* String containing the filename of an image, with most major formats supported.\n\n### resize(width, [height])\n\nScale to `width` x `height`. By default, the resized image is cropped to the exact size specified.\n\n`width` is the Number of pixels wide the resultant image should be. Use `null` or `undefined` to auto-scale the width to match the height.\n\n`height` is the Number of pixels high the resultant image should be. Use `null` or `undefined` to auto-scale the height to match the width.\n\n### crop()\n\nCrop the resized image to the exact size specified, the default behaviour.\n\n### max()\n\nPreserving aspect ratio, resize the image to the maximum width or height specified.\n\nBoth `width` and `height` must be provided via `resize` otherwise the behaviour will default to `crop`.\n\n### embedWhite()\n\nEmbed the resized image on a white background of the exact size specified.\n\n### embedBlack()\n\nEmbed the resized image on a black background of the exact size specified.\n\n### sharpen()\n\nPerform a mild sharpen of the resultant image. This typically reduces performance by 30%.\n\n### progressive()\n\nUse progressive (interlace) scan for JPEG and PNG output. This typically reduces compression performance by 30% but results in an image that can be rendered sooner when decompressed.\n\n### quality(quality)\n\nThe output quality to use for lossy JPEG, WebP and TIFF output formats. The default quality is `80`.\n\n`quality` is a Number between 1 and 100.\n\n### compressionLevel(compressionLevel)\n\nAn advanced setting for the _zlib_ compression level of the lossless PNG output format. The default level is `6`.\n\n`compressionLevel` is a Number between -1 and 9.\n\n### sequentialRead()\n\nAn advanced setting that switches the libvips access method to `VIPS_ACCESS_SEQUENTIAL`. This will reduce memory usage and can improve performance on some systems.\n\n### write(filename, callback)\n\n`filename` is a String containing the filename to write the image data to. The format is inferred from the extension, with JPEG, PNG, WebP and TIFF supported.\n\n`callback` is called with a single argument `(err)` containing an error message, if any.\n\n### jpeg(callback)\n\nWrite JPEG image data to a Buffer.\n\n`callback` gets two arguments `(err, buffer)` where `err` is an error message, if any, and `buffer` is the resultant JPEG image data.\n\n### png(callback)\n\nWrite PNG image data to a Buffer.\n\n`callback` gets two arguments `(err, buffer)` where `err` is an error message, if any, and `buffer` is the resultant PNG image data.\n\n### webp(callback)\n\nWrite WebP image data to a Buffer.\n\n`callback` gets two arguments `(err, buffer)` where `err` is an error message, if any, and `buffer` is the resultant WebP image data.\n\n### toBuffer(callback)\n\nWrite image data to a Buffer, the format of which will match the input image. JPEG, PNG and WebP are supported.\n\n`callback` gets two arguments `(err, buffer)` where `err` is an error message, if any, and `buffer` is the resultant image data.\n\n### sharp.cache([limit])\n\nIf `limit` is provided, set the (soft) limit of _libvips_ working/cache memory to this value in MB. The default value is 100.\n\nThis method always returns cache statistics, useful for determining how much working memory is required for a particular task.\n\nWarnings such as _Application transferred too many scanlines_ are a good indicator you\'ve set this value too low.\n\n```javascript\nvar stats = sharp.cache(); // { current: 98, high: 115, limit: 100 }\nsharp.cache(200); // { current: 98, high: 115, limit: 200 }\nsharp.cache(50); // { current: 49, high: 115, limit: 50 }\n```\n\n## Testing\n\n[![Build Status](https://travis-ci.org/lovell/sharp.png?branch=master)](https://travis-ci.org/lovell/sharp)\n\n\tnpm test\n\nRunning the tests requires both ImageMagick and GraphicsMagick plus one of either libmagick++-dev or libgraphicsmagick++.\n\n\tbrew install imagemagick\n\tbrew install graphicsmagick\n\n\tsudo apt-get install imagemagick graphicsmagick libmagick++-dev\n\n## Performance\n\n### Test environment\n\n* Intel Xeon [L5520](http://ark.intel.com/products/40201/Intel-Xeon-Processor-L5520-8M-Cache-2_26-GHz-5_86-GTs-Intel-QPI) 2.27GHz 8MB cache\n* Ubuntu 13.10\n* libvips 7.38.5\n\n### The contenders\n\n* [imagemagick-native](https://github.com/mash/node-imagemagick-native) - Supports Buffers only and blocks main V8 thread whilst processing.\n* [imagemagick](https://github.com/rsms/node-imagemagick) - Supports filesystem only and "has been unmaintained for a long time".\n* [gm](https://github.com/aheckmann/gm) - Fully featured wrapper around GraphicsMagick.\n* sharp - Caching within libvips disabled to ensure a fair comparison.\n\n### The task\n\nDecompress a 2725x2225 JPEG image, resize and crop to 720x480, then compress to JPEG.\n\n### Results\n\n| Module | Input | Output | Ops/sec | Speed-up |\n| :-------------------- | :----- | :----- | ------: | -------: |\n| imagemagick-native | buffer | buffer | 0.97 | 1 |\n| imagemagick | file | file | 2.49 | 2.6 |\n| gm | buffer | file | 3.72 | 3.8 |\n| gm | buffer | buffer | 3.80 | 3.9 |\n| gm | file | file | 3.67 | 3.8 |\n| gm | file | buffer | 3.67 | 3.8 |\n| sharp | buffer | file | 13.62 | 14.0 |\n| sharp | buffer | buffer | 12.43 | 12.8 |\n| sharp | file | file | 13.02 | 13.4 |\n| sharp | file | buffer | 11.15 | 11.5 |\n| sharp +sharpen | file | buffer | 10.26 | 10.6 |\n| sharp +progressive | file | buffer | 9.44 | 9.7 |\n| sharp +sequentialRead | file | buffer | 11.94 | 12.3 |\n\nYou can expect much greater performance with caching enabled (default) and using 16+ core machines.\n\n## Licence\n\nCopyright 2013, 2014 Lovell Fuller and Pierre Inglebert\n\nLicensed under the Apache License, Version 2.0 (the "License");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0.html)\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an "AS IS" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n',
63 silly resolved readmeFilename: 'README.md',
63 silly resolved bugs: { url: 'https://github.com/lovell/sharp/issues' },
63 silly resolved homepage: 'https://github.com/lovell/sharp',
63 silly resolved _id: 'sharp@0.4.0',
63 silly resolved _shasum: 'c34b79f1eaff8f4969d4817fbba0844dc8e73a62',
63 silly resolved _from: 'sharp@^0.4.0',
63 silly resolved _resolved: 'https://registry.npmjs.org/sharp/-/sharp-0.4.0.tgz' } ]
64 info install sharp@0.4.0 into /vagrant
65 info installOne sharp@0.4.0
66 info /vagrant/node_modules/sharp unbuild
67 verbose tar unpack /home/vagrant/.npm/sharp/0.4.0/package.tgz
68 silly lockFile e62dceee-tar-vagrant-node-modules-sharp tar:///vagrant/node_modules/sharp
69 verbose lock tar:///vagrant/node_modules/sharp /home/vagrant/.npm/e62dceee-tar-vagrant-node-modules-sharp.lock
70 silly lockFile 10beeb54-rant-npm-sharp-0-4-0-package-tgz tar:///home/vagrant/.npm/sharp/0.4.0/package.tgz
71 verbose lock tar:///home/vagrant/.npm/sharp/0.4.0/package.tgz /home/vagrant/.npm/10beeb54-rant-npm-sharp-0-4-0-package-tgz.lock
72 silly gunzTarPerm modes [ '755', '644' ]
73 silly gunzTarPerm extractEntry package.json
74 silly gunzTarPerm extractEntry .npmignore
75 silly gunzTarPerm extractEntry README.md
76 silly gunzTarPerm extractEntry LICENSE
77 silly gunzTarPerm extractEntry index.js
78 silly gunzTarPerm extractEntry binding.gyp
79 silly gunzTarPerm extractEntry src/sharp.cc
80 silly lockFile e62dceee-tar-vagrant-node-modules-sharp tar:///vagrant/node_modules/sharp
81 silly lockFile e62dceee-tar-vagrant-node-modules-sharp tar:///vagrant/node_modules/sharp
82 silly lockFile 10beeb54-rant-npm-sharp-0-4-0-package-tgz tar:///home/vagrant/.npm/sharp/0.4.0/package.tgz
83 silly lockFile 10beeb54-rant-npm-sharp-0-4-0-package-tgz tar:///home/vagrant/.npm/sharp/0.4.0/package.tgz
84 info preinstall sharp@0.4.0
85 verbose readDependencies using package.json deps
86 verbose readDependencies using package.json deps
87 verbose cache add [ 'nan@^1.0.0', null ]
88 verbose cache add name=undefined spec="nan@^1.0.0" args=["nan@^1.0.0",null]
89 verbose parsed url { protocol: null,
89 verbose parsed url slashes: null,
89 verbose parsed url auth: null,
89 verbose parsed url host: null,
89 verbose parsed url port: null,
89 verbose parsed url hostname: null,
89 verbose parsed url hash: null,
89 verbose parsed url search: null,
89 verbose parsed url query: null,
89 verbose parsed url pathname: 'nan@^1.0.0',
89 verbose parsed url path: 'nan@^1.0.0',
89 verbose parsed url href: 'nan@^1.0.0' }
90 verbose cache add name="nan" spec="^1.0.0" args=["nan","^1.0.0"]
91 verbose parsed url { protocol: null,
91 verbose parsed url slashes: null,
91 verbose parsed url auth: null,
91 verbose parsed url host: null,
91 verbose parsed url port: null,
91 verbose parsed url hostname: null,
91 verbose parsed url hash: null,
91 verbose parsed url search: null,
91 verbose parsed url query: null,
91 verbose parsed url pathname: '^1.0.0',
91 verbose parsed url path: '^1.0.0',
91 verbose parsed url href: '^1.0.0' }
92 verbose addNamed [ 'nan', '^1.0.0' ]
93 verbose addNamed [ null, '>=1.0.0-0 <2.0.0-0' ]
94 silly lockFile 1d17734b-nan-1-0-0 nan@^1.0.0
95 verbose lock nan@^1.0.0 /home/vagrant/.npm/1d17734b-nan-1-0-0.lock
96 silly addNameRange { name: 'nan', range: '>=1.0.0-0 <2.0.0-0', hasData: false }
97 verbose url raw nan
98 verbose url resolving [ 'https://registry.npmjs.org/', './nan' ]
99 verbose url resolved https://registry.npmjs.org/nan
100 info trying registry request attempt 1 at 16:20:19
101 http GET https://registry.npmjs.org/nan
102 http 200 https://registry.npmjs.org/nan
103 silly registry.get cb [ 200,
103 silly registry.get { date: 'Wed, 21 May 2014 16:20:19 GMT',
103 silly registry.get server: 'CouchDB/1.5.0 (Erlang OTP/R14B04)',
103 silly registry.get etag: '"AHXQ5MEXNAVAQ8W9Q2GUKPOL"',
103 silly registry.get 'content-type': 'application/json',
103 silly registry.get via: '1.1 varnish',
103 silly registry.get 'cache-control': 'max-age=1',
103 silly registry.get 'content-length': '61944',
103 silly registry.get 'accept-ranges': 'bytes',
103 silly registry.get age: '146',
103 silly registry.get 'x-served-by': 'cache-v41-ASH, cache-lcy1121-LCY',
103 silly registry.get 'x-cache': 'HIT, HIT',
103 silly registry.get 'x-cache-hits': '1, 1',
103 silly registry.get 'x-timer': 'S1400597592.175544500,VS0,VS37,VE131,VE91627521',
103 silly registry.get vary: 'Accept',
103 silly registry.get 'keep-alive': 'timeout=10, max=50',
103 silly registry.get connection: 'Keep-Alive' } ]
104 silly addNameRange number 2 { name: 'nan', range: '>=1.0.0-0 <2.0.0-0', hasData: true }
105 silly addNameRange versions [ 'nan',
105 silly addNameRange [ '0.3.0-wip',
105 silly addNameRange '0.3.0-wip2',
105 silly addNameRange '0.3.0',
105 silly addNameRange '0.3.1',
105 silly addNameRange '0.3.2',
105 silly addNameRange '0.4.0',
105 silly addNameRange '0.4.1',
105 silly addNameRange '0.4.2',
105 silly addNameRange '0.4.3',
105 silly addNameRange '0.4.4',
105 silly addNameRange '0.5.0',
105 silly addNameRange '0.5.1',
105 silly addNameRange '0.5.2',
105 silly addNameRange '0.6.0',
105 silly addNameRange '0.7.0',
105 silly addNameRange '0.7.1',
105 silly addNameRange '0.8.0',
105 silly addNameRange '1.0.0' ] ]
106 verbose addNamed [ 'nan', '1.0.0' ]
107 verbose addNamed [ '1.0.0', '1.0.0' ]
108 silly lockFile cc7fa090-nan-1-0-0 nan@1.0.0
109 verbose lock nan@1.0.0 /home/vagrant/.npm/cc7fa090-nan-1-0-0.lock
110 silly lockFile 31e73d2e-stry-npmjs-org-nan-nan-1-0-0-tgz https://registry.npmjs.org/nan/-/nan-1.0.0.tgz
111 verbose lock https://registry.npmjs.org/nan/-/nan-1.0.0.tgz /home/vagrant/.npm/31e73d2e-stry-npmjs-org-nan-nan-1-0-0-tgz.lock
112 verbose addRemoteTarball [ 'https://registry.npmjs.org/nan/-/nan-1.0.0.tgz',
112 verbose addRemoteTarball 'ae24f8850818d662fcab5acf7f3b95bfaa2ccf38' ]
113 info retry fetch attempt 1 at 16:20:19
114 verbose fetch to= /home/vagrant/tmp/npm-14485-9uE7MOP7/1400689219996-0.6513375593349338/tmp.tgz
115 http GET https://registry.npmjs.org/nan/-/nan-1.0.0.tgz
116 http 200 https://registry.npmjs.org/nan/-/nan-1.0.0.tgz
117 verbose tar unpack /home/vagrant/tmp/npm-14485-9uE7MOP7/1400689219996-0.6513375593349338/tmp.tgz
118 silly lockFile 118f4e8a-me-vagrant-npm-nan-1-0-0-package tar:///home/vagrant/.npm/nan/1.0.0/package
119 verbose lock tar:///home/vagrant/.npm/nan/1.0.0/package /home/vagrant/.npm/118f4e8a-me-vagrant-npm-nan-1-0-0-package.lock
120 silly lockFile 9abb8d7e-19996-0-6513375593349338-tmp-tgz tar:///home/vagrant/tmp/npm-14485-9uE7MOP7/1400689219996-0.6513375593349338/tmp.tgz
121 verbose lock tar:///home/vagrant/tmp/npm-14485-9uE7MOP7/1400689219996-0.6513375593349338/tmp.tgz /home/vagrant/.npm/9abb8d7e-19996-0-6513375593349338-tmp-tgz.lock
122 silly gunzTarPerm modes [ '755', '644' ]
123 silly gunzTarPerm extractEntry package.json
124 silly gunzTarPerm extractEntry README.md
125 silly gunzTarPerm extractEntry LICENSE
126 silly gunzTarPerm extractEntry include_dirs.js
127 silly gunzTarPerm extractEntry .dntrc
128 silly gunzTarPerm extractEntry build/config.gypi
129 silly gunzTarPerm extractEntry nan.h
130 silly lockFile 118f4e8a-me-vagrant-npm-nan-1-0-0-package tar:///home/vagrant/.npm/nan/1.0.0/package
131 silly lockFile 118f4e8a-me-vagrant-npm-nan-1-0-0-package tar:///home/vagrant/.npm/nan/1.0.0/package
132 silly lockFile 9abb8d7e-19996-0-6513375593349338-tmp-tgz tar:///home/vagrant/tmp/npm-14485-9uE7MOP7/1400689219996-0.6513375593349338/tmp.tgz
133 silly lockFile 9abb8d7e-19996-0-6513375593349338-tmp-tgz tar:///home/vagrant/tmp/npm-14485-9uE7MOP7/1400689219996-0.6513375593349338/tmp.tgz
134 silly lockFile 31e73d2e-stry-npmjs-org-nan-nan-1-0-0-tgz https://registry.npmjs.org/nan/-/nan-1.0.0.tgz
135 silly lockFile 31e73d2e-stry-npmjs-org-nan-nan-1-0-0-tgz https://registry.npmjs.org/nan/-/nan-1.0.0.tgz
136 silly lockFile cc7fa090-nan-1-0-0 nan@1.0.0
137 silly lockFile cc7fa090-nan-1-0-0 nan@1.0.0
138 silly lockFile 1d17734b-nan-1-0-0 nan@^1.0.0
139 silly lockFile 1d17734b-nan-1-0-0 nan@^1.0.0
140 silly resolved [ { name: 'nan',
140 silly resolved version: '1.0.0',
140 silly resolved description: 'Native Abstractions for Node.js: C++ header for Node 0.8->0.12 compatibility',
140 silly resolved main: 'include_dirs.js',
140 silly resolved repository: { type: 'git', url: 'git://github.com/rvagg/nan.git' },
140 silly resolved contributors: [ [Object], [Object], [Object], [Object], [Object], [Object] ],
140 silly resolved license: 'MIT',
140 silly resolved readme: 'Native Abstractions for Node.js\n===============================\n\n**A header file filled with macro and utility goodness for making add-on development for Node.js easier across versions 0.8, 0.10 and 0.11, and eventually 0.12.**\n\n***Current version: 1.0.0*** *(See [nan.h](https://github.com/rvagg/nan/blob/master/nan.h) for complete ChangeLog)*\n\n[![NPM](https://nodei.co/npm/nan.png?downloads=true)](https://nodei.co/npm/nan/) [![NPM](https://nodei.co/npm-dl/nan.png?months=6)](https://nodei.co/npm/nan/)\n\nThanks to the crazy changes in V8 (and some in Node core), keeping native addons compiling happily across versions, particularly 0.10 to 0.11/0.12, is a minor nightmare. The goal of this project is to store all logic necessary to develop native Node.js addons without having to inspect `NODE_MODULE_VERSION` and get yourself into a macro-tangle.\n\nThis project also contains some helper utilities that make addon development a bit more pleasant.\n\n * **[News & Updates](#news)**\n * **[Usage](#usage)**\n * **[Example](#example)**\n * **[API](#api)**\n\n<a name="news"></a>\n## News & Updates\n\n### May-2013: Major changes for V8 3.25 / Node 0.11.13\n\nNode 0.11.11 and 0.11.12 were both broken releases for native add-ons, you simply can\'t properly compile against either of them for different reasons. But we now have a 0.11.13 release that jumps a couple of versions of V8 ahead and includes some more, major (traumatic) API changes.\n\nBecause we are now nearing Node 0.12 and estimate that the version of V8 we are using in Node 0.11.13 will be close to the API we get for 0.12, we have taken the opportunity to not only *fix* NAN for 0.11.13 but make some major changes to improve the NAN API.\n\nWe have **removed support for Node 0.11 versions prior to 0.11.13**, (although our tests are still passing for 0.11.10). As usual, our tests are run against (and pass) the last 5 versions of Node 0.8 and Node 0.10. We also include Node 0.11.13 obviously.\n\nThe major change is something that [Benjamin Byholm](kkoopa) has put many hours in to. We now have a fantastic new `NanNew<T>(args)` interface for creating new `Local`s, this replaces `NanNewLocal()` and much more. If you look in [./nan.h](nan.h) you\'ll see a large number of overloaded versions of this method. In general you should be able to `NanNew<Type>(arguments)` for any type you want to make a `Local` from. This includes `Persistent` types, so we now have a `Local<T> NanNew(const Persistent<T> arg)` to replace `NanPersistentToLocal()`.\n\nWe also now have `NanUndefined()`, `NanNull()`, `NanTrue()` and `NanFalse()`. Mainly because of the new requirement for an `Isolate` argument for each of the native V8 versions of this.\n\nV8 has now introduced an `EscapableHandleScope` from which you `scope.Escape(Local<T> value)` to *return* a value from a one scope to another. This replaces the standard `HandleScope` and `scope.Close(Local<T> value)`, although `HandleScope` still exists for when you don\'t need to return a handle to the caller. For NAN we are exposing it as `NanEscapableScope()` and `NanEscapeScope()`, while `NanScope()` is still how you create a new scope that doesn\'t need to return handles. For older versions of Node/V8, it\'ll still map to the older `HandleScope` functionality.\n\n`NanFromV8String()` was deprecated and has now been removed. You should use `NanCString()` or `NanRawString()` instead.\n\nBecause `node::MakeCallback()` now takes an `Isolate`, and because it doesn\'t exist in older versions of Node, we\'ve introduced `NanMakeCallabck()`. You should *always* use this when calling a JavaScript function from C++.\n\nThere\'s lots more, check out the Changelog in nan.h or look through [#86](https://github.com/rvagg/nan/pull/86) for all the gory details.\n\n### Dec-2013: NanCString and NanRawString\n\nTwo new functions have been introduced to replace the functionality that\'s been provided by `NanFromV8String` until now. NanCString has sensible defaults so it\'s super easy to fetch a null-terminated c-style string out of a `v8::String`. `NanFromV8String` is still around and has defaults that allow you to pass a single handle to fetch a `char*` while `NanRawString` requires a little more attention to arguments.\n\n### Nov-2013: Node 0.11.9+ breaking V8 change\n\nThe version of V8 that\'s shipping with Node 0.11.9+ has changed the signature for new `Local`s to: `v8::Local<T>::New(isolate, value)`, i.e. introducing the `isolate` argument and therefore breaking all new `Local` declarations for previous versions. NAN 0.6+ now includes a `NanNewLocal<T>(value)` that can be used in place to work around this incompatibility and maintain compatibility with 0.8->0.11.9+ (minus a few early 0.11 releases).\n\nFor example, if you wanted to return a `null` on a callback you will have to change the argument from `v8::Local<v8::Value>::New(v8::Null())` to `NanNewLocal<v8::Value>(v8::Null())`.\n\n### Nov-2013: Change to binding.gyp `"include_dirs"` for NAN\n\nInclusion of NAN in a project\'s binding.gyp is now greatly simplified. You can now just use `"<!(node -e \\"require(\'nan\')\\")"` in your `"include_dirs"`, see example below (note Windows needs the quoting around `require` to be just right: `"require(\'nan\')"` with appropriate `\\` escaping).\n\n<a name="usage"></a>\n## Usage\n\nSimply add **NAN** as a dependency in the *package.json* of your Node addon:\n\n``` bash\n$ npm install --save nan\n```\n\nPull in the path to **NAN** in your *binding.gyp* so that you can use `#include <nan.h>` in your *.cpp* files:\n\n``` python\n"include_dirs" : [\n "<!(node -e \\"require(\'nan\')\\")"\n]\n```\n\nThis works like a `-I<path-to-NAN>` when compiling your addon.\n\n<a name="example"></a>\n## Example\n\nSee **[LevelDOWN](https://github.com/rvagg/node-leveldown/pull/48)** for a full example of **NAN** in use.\n\nFor a simpler example, see the **[async pi estimation example](https://github.com/rvagg/nan/tree/master/examples/async_pi_estimate)** in the examples directory for full code and an explanation of what this Monte Carlo Pi estimation example does. Below are just some parts of the full example that illustrate the use of **NAN**.\n\nCompare to the current 0.10 version of this example, found in the [node-addon-examples](https://github.com/rvagg/node-addon-examples/tree/master/9_async_work) repository and also a 0.11 version of the same found [here](https://github.com/kkoopa/node-addon-examples/tree/5c01f58fc993377a567812597e54a83af69686d7/9_async_work).\n\nNote that there is no embedded version sniffing going on here and also the async work is made much simpler, see below for details on the `NanAsyncWorker` class.\n\n```c++\n// addon.cc\n#include <node.h>\n#include <nan.h>\n// ...\n\nusing v8::FunctionTemplate;\nusing v8::Handle;\nusing v8::Object;\n\nvoid InitAll(Handle<Object> exports) {\n exports->Set(NanSymbol("calculateSync"),\n NanNew<FunctionTemplate>(CalculateSync)->GetFunction());\n\n exports->Set(NanSymbol("calculateAsync"),\n NanNew<FunctionTemplate>(CalculateAsync)->GetFunction());\n}\n\nNODE_MODULE(addon, InitAll)\n```\n\n```c++\n// sync.h\n#include <node.h>\n#include <nan.h>\n\nNAN_METHOD(CalculateSync);\n```\n\n```c++\n// sync.cc\n#include <node.h>\n#include <nan.h>\n#include "./sync.h"\n// ...\n\nusing v8::Number;\n\n// Simple synchronous access to the `Estimate()` function\nNAN_METHOD(CalculateSync) {\n NanScope();\n\n // expect a number as the first argument\n int points = args[0]->Uint32Value();\n double est = Estimate(points);\n\n NanReturnValue(NanNew<Number>(est));\n}\n```\n\n```c++\n// async.cc\n#include <node.h>\n#include <nan.h>\n#include "./async.h"\n\n// ...\n\nusing v8::Function;\nusing v8::Local;\nusing v8::Null;\nusing v8::Number;\nusing v8::Value;\n\nclass PiWorker : public NanAsyncWorker {\n public:\n PiWorker(NanCallback *callback, int points)\n : NanAsyncWorker(callback), points(points) {}\n ~PiWorker() {}\n\n // Executed inside the worker-thread.\n // It is not safe to access V8, or V8 data structures\n // here, so everything we need for input and output\n // should go on `this`.\n void Execute () {\n estimate = Estimate(points);\n }\n\n // Executed when the async work is complete\n // this function will be run inside the main event loop\n // so it is safe to use V8 again\n void HandleOKCallback () {\n NanScope();\n\n Local<Value> argv[] = {\n NanNew(NanNull())\n , NanNew<Number>(estimate)\n };\n\n callback->Call(2, argv);\n };\n\n private:\n int points;\n double estimate;\n};\n\n// Asynchronous access to the `Estimate()` function\nNAN_METHOD(CalculateAsync) {\n NanScope();\n\n int points = args[0]->Uint32Value();\n NanCallback *callback = new NanCallback(args[1].As<Function>());\n\n NanAsyncQueueWorker(new PiWorker(callback, points));\n NanReturnUndefined();\n}\n```\n\n<a name="api"></a>\n## API\n\n * <a href="#api_nan_method"><b><code>NAN_METHOD</code></b></a>\n * <a href="#api_nan_getter"><b><code>NAN_GETTER</code></b></a>\n * <a href="#api_nan_setter"><b><code>NAN_SETTER</code></b></a>\n * <a href="#api_nan_property_getter"><b><code>NAN_PROPERTY_GETTER</code></b></a>\n * <a href="#api_nan_property_setter"><b><code>NAN_PROPERTY_SETTER</code></b></a>\n * <a href="#api_nan_property_enumerator"><b><code>NAN_PROPERTY_ENUMERATOR</code></b></a>\n * <a href="#api_nan_property_deleter"><b><code>NAN_PROPERTY_DELETER</code></b></a>\n * <a href="#api_nan_property_query"><b><code>NAN_PROPERTY_QUERY</code></b></a>\n * <a href="#api_nan_index_getter"><b><code>NAN_INDEX_GETTER</code></b></a>\n * <a href="#api_nan_index_setter"><b><code>NAN_INDEX_SETTER</code></b></a>\n * <a href="#api_nan_index_enumerator"><b><code>NAN_INDEX_ENUMERATOR</code></b></a>\n * <a href="#api_nan_index_deleter"><b><code>NAN_INDEX_DELETER</code></b></a>\n * <a href="#api_nan_index_query"><b><code>NAN_INDEX_QUERY</code></b></a>\n * <a href="#api_nan_weak_callback"><b><code>NAN_WEAK_CALLBACK</code></b></a>\n * <a href="#api_nan_deprecated"><b><code>NAN_DEPRECATED</code></b></a>\n * <a href="#api_nan_inline"><b><code>NAN_INLINE</code></b></a>\n * <a href="#api_nan_new"><b><code>NanNew</code></b></a>\n * <a href="#api_nan_undefined"><b><code>NanUndefined</code></b></a>\n * <a href="#api_nan_null"><b><code>NanNull</code></b></a>\n * <a href="#api_nan_true"><b><code>NanTrue</code></b></a>\n * <a href="#api_nan_false"><b><code>NanFalse</code></b></a>\n * <a href="#api_nan_return_value"><b><code>NanReturnValue</code></b></a>\n * <a href="#api_nan_return_undefined"><b><code>NanReturnUndefined</code></b></a>\n * <a href="#api_nan_return_null"><b><code>NanReturnNull</code></b></a>\n * <a href="#api_nan_return_empty_string"><b><code>NanReturnEmptyString</code></b></a>\n * <a href="#api_nan_scope"><b><code>NanScope</code></b></a>\n * <a href="#api_nan_escapable_scope"><b><code>NanEscapableScope</code></b></a>\n * <a href="#api_nan_escape_scope"><b><code>NanEscapeScope</code></b></a>\n * <a href="#api_nan_locker"><b><code>NanLocker</code></b></a>\n * <a href="#api_nan_unlocker"><b><code>NanUnlocker</code></b></a>\n * <a href="#api_nan_get_internal_field_pointer"><b><code>NanGetInternalFieldPointer</code></b></a>\n * <a href="#api_nan_set_internal_field_pointer"><b><code>NanSetInternalFieldPointer</code></b></a>\n * <a href="#api_nan_object_wrap_handle"><b><code>NanObjectWrapHandle</code></b></a>\n * <a href="#api_nan_symbol"><b><code>NanSymbol</code></b></a>\n * <a href="#api_nan_get_pointer_safe"><b><code>NanGetPointerSafe</code></b></a>\n * <a href="#api_nan_set_pointer_safe"><b><code>NanSetPointerSafe</code></b></a>\n * <a href="#api_nan_raw_string"><b><code>NanRawString</code></b></a>\n * <a href="#api_nan_c_string"><b><code>NanCString</code></b></a>\n * <a href="#api_nan_boolean_option_value"><b><code>NanBooleanOptionValue</code></b></a>\n * <a href="#api_nan_uint32_option_value"><b><code>NanUInt32OptionValue</code></b></a>\n * <a href="#api_nan_error"><b><code>NanError</code></b>, <b><code>NanTypeError</code></b>, <b><code>NanRangeError</code></b></a>\n * <a href="#api_nan_throw_error"><b><code>NanThrowError</code></b>, <b><code>NanThrowTypeError</code></b>, <b><code>NanThrowRangeError</code></b>, <b><code>NanThrowError(Handle<Value>)</code></b>, <b><code>NanThrowError(Handle<Value>, int)</code></b></a>\n * <a href="#api_nan_new_buffer_handle"><b><code>NanNewBufferHandle(char *, size_t, FreeCallback, void *)</code></b>, <b><code>NanNewBufferHandle(char *, uint32_t)</code></b>, <b><code>NanNewBufferHandle(uint32_t)</code></b></a>\n * <a href="#api_nan_buffer_use"><b><code>NanBufferUse(char *, uint32_t)</code></b></a>\n * <a href="#api_nan_new_context_handle"><b><code>NanNewContextHandle</code></b></a>\n * <a href="#api_nan_get_current_context"><b><code>NanGetCurrentContext</code></b></a>\n * <a href="#api_nan_has_instance"><b><code>NanHasInstance</code></b></a>\n * <a href="#api_nan_dispose_persistent"><b><code>NanDisposePersistent</code></b></a>\n * <a href="#api_nan_assign_persistent"><b><code>NanAssignPersistent</code></b></a>\n * <a href="#api_nan_make_weak_persistent"><b><code>NanMakeWeakPersistent</code></b></a>\n * <a href="#api_nan_set_template"><b><code>NanSetTemplate</code></b></a>\n * <a href="#api_nan_make_callback"><b><code>NanMakeCallback</code></b></a>\n * <a href="#api_nan_compile_script"><b><code>NanCompileScript</code></b></a>\n * <a href="#api_nan_run_script"><b><code>NanRunScript</code></b></a>\n * <a href="#api_nan_adjust_external_memory"><b><code>NanAdjustExternalMemory</code></b></a>\n * <a href="#api_nan_add_gc_epilogue_callback"><b><code>NanAddGCEpilogueCallback</code></b></a>\n * <a href="#api_nan_add_gc_prologue_callback"><b><code>NanAddGCPrologueCallback</code></b></a>\n * <a href="#api_nan_remove_gc_epilogue_callback"><b><code>NanRemoveGCEpilogueCallback</code></b></a>\n * <a href="#api_nan_remove_gc_prologue_callback"><b><code>NanRemoveGCPrologueCallback</code></b></a>\n * <a href="#api_nan_get_heap_statistics"><b><code>NanGetHeapStatistics</code></b></a>\n * <a href="#api_nan_callback"><b><code>NanCallback</code></b></a>\n * <a href="#api_nan_async_worker"><b><code>NanAsyncWorker</code></b></a>\n * <a href="#api_nan_async_queue_worker"><b><code>NanAsyncQueueWorker</code></b></a>\n\n<a name="api_nan_method"></a>\n### NAN_METHOD(methodname)\n\nUse `NAN_METHOD` to define your V8 accessible methods:\n\n```c++\n// .h:\nclass Foo : public node::ObjectWrap {\n ...\n\n static NAN_METHOD(Bar);\n static NAN_METHOD(Baz);\n}\n\n\n// .cc:\nNAN_METHOD(Foo::Bar) {\n ...\n}\n\nNAN_METHOD(Foo::Baz) {\n ...\n}\n```\n\nThe reason for this macro is because of the method signature change in 0.11:\n\n```c++\n// 0.10 and below:\nHandle<Value> name(const Arguments& args)\n\n// 0.11 and above\nvoid name(const FunctionCallbackInfo<Value>& args)\n```\n\nThe introduction of `FunctionCallbackInfo` brings additional complications:\n\n<a name="api_nan_getter"></a>\n### NAN_GETTER(methodname)\n\nUse `NAN_GETTER` to declare your V8 accessible getters. You get a `Local<String>` `property` and an appropriately typed `args` object that can act like the `args` argument to a `NAN_METHOD` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_GETTER`.\n\n<a name="api_nan_setter"></a>\n### NAN_SETTER(methodname)\n\nUse `NAN_SETTER` to declare your V8 accessible setters. Same as `NAN_GETTER` but you also get a `Local<Value>` `value` object to work with.\n\n<a name="api_nan_property_getter"></a>\n### NAN_PROPERTY_GETTER(cbname)\nUse `NAN_PROPERTY_GETTER` to declare your V8 accessible property getters. You get a `Local<String>` `property` and an appropriately typed `args` object that can act similar to the `args` argument to a `NAN_METHOD` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_GETTER`.\n\n<a name="api_nan_property_setter"></a>\n### NAN_PROPERTY_SETTER(cbname)\nUse `NAN_PROPERTY_SETTER` to declare your V8 accessible property setters. Same as `NAN_PROPERTY_GETTER` but you also get a `Local<Value>` `value` object to work with.\n\n<a name="api_nan_property_enumerator"></a>\n### NAN_PROPERTY_ENUMERATOR(cbname)\nUse `NAN_PROPERTY_ENUMERATOR` to declare your V8 accessible property enumerators. You get an appropriately typed `args` object like the `args` argument to a `NAN_PROPERTY_GETTER` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_ENUMERATOR`.\n\n<a name="api_nan_property_deleter"></a>\n### NAN_PROPERTY_DELETER(cbname)\nUse `NAN_PROPERTY_DELETER` to declare your V8 accessible property deleters. Same as `NAN_PROPERTY_GETTER`.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_DELETER`.\n\n<a name="api_nan_property_query"></a>\n### NAN_PROPERTY_QUERY(cbname)\nUse `NAN_PROPERTY_QUERY` to declare your V8 accessible property queries. Same as `NAN_PROPERTY_GETTER`.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_PROPERTY_QUERY`.\n\n<a name="api_nan_index_getter"></a>\n### NAN_INDEX_GETTER(cbname)\nUse `NAN_INDEX_GETTER` to declare your V8 accessible index getters. You get a `uint32_t` `index` and an appropriately typed `args` object that can act similar to the `args` argument to a `NAN_METHOD` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_GETTER`.\n\n<a name="api_nan_index_setter"></a>\n### NAN_INDEX_SETTER(cbname)\nUse `NAN_INDEX_SETTER` to declare your V8 accessible index setters. Same as `NAN_INDEX_GETTER` but you also get a `Local<Value>` `value` object to work with.\n\n<a name="api_nan_index_enumerator"></a>\n### NAN_INDEX_ENUMERATOR(cbname)\nUse `NAN_INDEX_ENUMERATOR` to declare your V8 accessible index enumerators. You get an appropriately typed `args` object like the `args` argument to a `NAN_INDEX_GETTER` call.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_ENUMERATOR`.\n\n<a name="api_nan_index_deleter"></a>\n### NAN_INDEX_DELETER(cbname)\nUse `NAN_INDEX_DELETER` to declare your V8 accessible index deleters. Same as `NAN_INDEX_GETTER`.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_DELETER`.\n\n<a name="api_nan_index_query"></a>\n### NAN_INDEX_QUERY(cbname)\nUse `NAN_INDEX_QUERY` to declare your V8 accessible index queries. Same as `NAN_INDEX_GETTER`.\n\nYou can use `NanReturnNull()`, `NanReturnEmptyString()`, `NanReturnUndefined()` and `NanReturnValue()` in a `NAN_INDEX_QUERY`.\n\n<a name="api_nan_weak_callback"></a>\n### NAN_WEAK_CALLBACK(cbname)\n\nUse `NAN_WEAK_CALLBACK` to define your V8 WeakReference callbacks. Do not use for declaration. There is an argument object `const _NanWeakCallbackData<T, P> &data` allowing access to the weak object and the supplied parameter through its `GetValue` and `GetParameter` methods.\n\n```c++\nNAN_WEAK_CALLBACK(weakCallback) {\n int *parameter = data.GetParameter();\n NanMakeCallback(NanGetCurrentContext()->Global(), data.GetValue(), 0, NULL);\n if ((*parameter)++ == 0) {\n data.Revive();\n } else {\n delete parameter;\n data.Dispose();\n }\n}\n```\n\n<a name="api_nan_deprecated"></a>\n### NAN_DEPRECATED\nDeclares a function as deprecated.\n\n```c++\nstatic NAN_DEPRECATED NAN_METHOD(foo) {\n ...\n}\n```\n\n<a name="api_nan_inline"></a>\n### NAN_INLINE\nInlines a function.\n\n```c++\nNAN_INLINE int foo(int bar) {\n ...\n}\n```\n\n<a name="api_nan_new"></a>\n### Local&lt;T&gt; NanNew&lt;T&gt;( ... )\n\nUse `NanNew` to construct almost all v8 objects and make new local handles.\n\n```c++\nLocal<String> s = NanNew<String>("value");\n\n...\n\nPersistent<Object> o;\n\n...\n\nLocal<Object> lo = NanNew(o);\n\n```\n\n<a name="api_nan_undefined"></a>\n### Handle&lt;Primitive&gt; NanUndefined()\n\nUse instead of `Undefined()`\n\n<a name="api_nan_null"></a>\n### Handle&lt;Primitive&gt; NanNull()\n\nUse instead of `Null()`\n\n<a name="api_nan_true"></a>\n### Handle&lt;Primitive&gt; NanTrue()\n\nUse instead of `True()`\n\n<a name="api_nan_false"></a>\n### Handle&lt;Primitive&gt; NanFalse()\n\nUse instead of `False()`\n\n<a name="api_nan_return_value"></a>\n### NanReturnValue(Handle&lt;Value&gt;)\n\nUse `NanReturnValue` when you want to return a value from your V8 accessible method:\n\n```c++\nNAN_METHOD(Foo::Bar) {\n ...\n\n NanReturnValue(NanNew<String>("FooBar!"));\n}\n```\n\nNo `return` statement required.\n\n<a name="api_nan_return_undefined"></a>\n### NanReturnUndefined()\n\nUse `NanReturnUndefined` when you don\'t want to return anything from your V8 accessible method:\n\n```c++\nNAN_METHOD(Foo::Baz) {\n ...\n\n NanReturnUndefined();\n}\n```\n\n<a name="api_nan_return_null"></a>\n### NanReturnNull()\n\nUse `NanReturnNull` when you want to return `Null` from your V8 accessible method:\n\n```c++\nNAN_METHOD(Foo::Baz) {\n ...\n\n NanReturnNull();\n}\n```\n\n<a name="api_nan_return_empty_string"></a>\n### NanReturnEmptyString()\n\nUse `NanReturnEmptyString` when you want to return an empty `String` from your V8 accessible method:\n\n```c++\nNAN_METHOD(Foo::Baz) {\n ...\n\n NanReturnEmptyString();\n}\n```\n\n<a name="api_nan_scope"></a>\n### NanScope()\n\nThe introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanScope()` necessary, use it in place of `HandleScope scope`:\n\n```c++\nNAN_METHOD(Foo::Bar) {\n NanScope();\n\n NanReturnValue(NanNew<String>("FooBar!"));\n}\n```\n\n<a name="api_nan_escapable_scope"></a>\n### NanEscapableScope()\n\nThe separation of handle scopes into escapable and inescapable scopes makes `NanEscapableScope()` necessary, use it in place of `HandleScope scope` when you later wish to `Close()` the scope:\n\n```c++\nHandle<String> Foo::Bar() {\n NanEscapableScope();\n\n return NanEscapeScope(NanNew<String>("FooBar!"));\n}\n```\n\n<a name="api_nan_esacpe_scope"></a>\n### Local&lt;T&gt; NanEscapeScope(Handle&lt;T&gt; value);\nUse together with `NanEscapableScope` to escape the scope. Corresponds to `HandleScope::Close` or `EscapableHandleScope::Escape`.\n\n<a name="api_nan_locker"></a>\n### NanLocker()\n\nThe introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanLocker()` necessary, use it in place of `Locker locker`:\n\n```c++\nNAN_METHOD(Foo::Bar) {\n NanLocker();\n ...\n NanUnlocker();\n}\n```\n\n<a name="api_nan_unlocker"></a>\n### NanUnlocker()\n\nThe introduction of `isolate` references for many V8 calls in Node 0.11 makes `NanUnlocker()` necessary, use it in place of `Unlocker unlocker`:\n\n```c++\nNAN_METHOD(Foo::Bar) {\n NanLocker();\n ...\n NanUnlocker();\n}\n```\n\n<a name="api_nan_get_internal_field_pointer"></a>\n### void * NanGetInternalFieldPointer(Handle&lt;Object&gt;, int)\n\nGets a pointer to the internal field with at `index` from a V8 `Object` handle.\n\n```c++\nLocal<Object> obj;\n...\nNanGetInternalFieldPointer(obj, 0);\n```\n<a name="api_nan_set_internal_field_pointer"></a>\n### void NanSetInternalFieldPointer(Handle&lt;Object&gt;, int, void *)\n\nSets the value of the internal field at `index` on a V8 `Object` handle.\n\n```c++\nstatic Persistent<Function> dataWrapperCtor;\n...\nLocal<Object> wrapper = NanPersistentToLocal(dataWrapperCtor)->NewInstance();\nNanSetInternalFieldPointer(wrapper, 0, this);\n```\n\n<a name="api_nan_object_wrap_handle"></a>\n### Local&lt;Object&gt; NanObjectWrapHandle(Object)\n\nWhen you want to fetch the V8 object handle from a native object you\'ve wrapped with Node\'s `ObjectWrap`, you should use `NanObjectWrapHandle`:\n\n```c++\nNanObjectWrapHandle(iterator)->Get(NanSymbol("end"))\n```\n\n<a name="api_nan_symbol"></a>\n### String NanSymbol(char *)\n\nUse to create string symbol objects (i.e. `v8::String::NewSymbol(x)`), for getting and setting object properties, or names of objects.\n\n```c++\nbool foo = false;\nif (obj->Has(NanSymbol("foo")))\n foo = optionsObj->Get(NanSymbol("foo"))->BooleanValue()\n```\n\n<a name="api_nan_get_pointer_safe"></a>\n### Type NanGetPointerSafe(Type *[, Type])\n\nA helper for getting values from optional pointers. If the pointer is `NULL`, the function returns the optional default value, which defaults to `0`. Otherwise, the function returns the value the pointer points to.\n\n```c++\nchar *plugh(uint32_t *optional) {\n char res[] = "xyzzy";\n uint32_t param = NanGetPointerSafe<uint32_t>(optional, 0x1337);\n switch (param) {\n ...\n }\n NanSetPointerSafe<uint32_t>(optional, 0xDEADBEEF);\n} \n```\n\n<a name="api_nan_set_pointer_safe"></a>\n### bool NanSetPointerSafe(Type *, Type)\n\nA helper for setting optional argument pointers. If the pointer is `NULL`, the function simply returns `false`. Otherwise, the value is assigned to the variable the pointer points to.\n\n```c++\nconst char *plugh(size_t *outputsize) {\n char res[] = "xyzzy";\n if !(NanSetPointerSafe<size_t>(outputsize, strlen(res) + 1)) {\n ...\n }\n\n ...\n}\n```\n\n<a name="api_nan_raw_string"></a>\n### void* NanRawString(Handle&lt;Value&gt;, enum Nan::Encoding, size_t *, void *, size_t, int)\n\nWhen you want to convert a V8 `String` to a `char*` buffer, use `NanRawString`. You have to supply an encoding as well as a pointer to a variable that will be assigned the number of bytes in the returned string. It is also possible to supply a buffer and its length to the function in order not to have a new buffer allocated. The final argument allows setting `String::WriteOptions`.\nJust remember that you\'ll end up with an object that you\'ll need to `delete[]` at some point unless you supply your own buffer:\n\n```c++\nsize_t count;\nvoid* decoded = NanRawString(args[1], Nan::BASE64, &count, NULL, 0, String::HINT_MANY_WRITES_EXPECTED);\nchar param_copy[count];\nmemcpy(param_copy, decoded, count);\ndelete[] decoded;\n```\n\n<a name="api_nan_c_string"></a>\n### char* NanCString(Handle&lt;Value&gt;, size_t *[, char *, size_t, int])\n\nWhen you want to convert a V8 `String` to a null-terminated C `char*` use `NanCString`. The resulting `char*` will be UTF-8-encoded, and you need to supply a pointer to a variable that will be assigned the number of bytes in the returned string. It is also possible to supply a buffer and its length to the function in order not to have a new buffer allocated. The final argument allows optionally setting `String::WriteOptions`, which default to `v8::String::NO_OPTIONS`.\nJust remember that you\'ll end up with an object that you\'ll need to `delete[]` at some point unless you supply your own buffer:\n\n```c++\nsize_t count;\nchar* name = NanCString(args[0], &count);\n```\n\n<a name="api_nan_boolean_option_value"></a>\n### bool NanBooleanOptionValue(Handle&lt;Value&gt;, Handle&lt;String&gt;[, bool])\n\nWhen you have an "options" object that you need to fetch properties from, boolean options can be fetched with this pair. They check first if the object exists (`IsEmpty`), then if the object has the given property (`Has`) then they get and convert/coerce the property to a `bool`.\n\nThe optional last parameter is the *default* value, which is `false` if left off:\n\n```c++\n// `foo` is false unless the user supplies a truthy value for it\nbool foo = NanBooleanOptionValue(optionsObj, NanSymbol("foo"));\n// `bar` is true unless the user supplies a falsy value for it\nbool bar = NanBooleanOptionValueDefTrue(optionsObj, NanSymbol("bar"), true);\n```\n\n<a name="api_nan_uint32_option_value"></a>\n### uint32_t NanUInt32OptionValue(Handle&lt;Value&gt;, Handle&lt;String&gt;, uint32_t)\n\nSimilar to `NanBooleanOptionValue`, use `NanUInt32OptionValue` to fetch an integer option from your options object. Can be any kind of JavaScript `Number` and it will be coerced to an unsigned 32-bit integer.\n\nRequires all 3 arguments as a default is not optional:\n\n```c++\nuint32_t count = NanUInt32OptionValue(optionsObj, NanSymbol("count"), 1024);\n```\n\n<a name="api_nan_error"></a>\n### NanError(message), NanTypeError(message), NanRangeError(message)\n\nFor making `Error`, `TypeError` and `RangeError` objects.\n\n```c++\nLocal<Value> res = NanError("you must supply a callback argument");\n```\n\n<a name="api_nan_throw_error"></a>\n### NanThrowError(message), NanThrowTypeError(message), NanThrowRangeError(message), NanThrowError(Local&lt;Value&gt;), NanThrowError(Local&lt;Value&gt;, int)\n\nFor throwing `Error`, `TypeError` and `RangeError` objects. You should `return` this call:\n\n```c++\nreturn NanThrowError("you must supply a callback argument");\n```\n\nCan also handle any custom object you may want to throw. If used with the error code argument, it will add the supplied error code to the error object as a property called `code`.\n\n<a name="api_nan_new_buffer_handle"></a>\n### Local&lt;Object&gt; NanNewBufferHandle(char *, uint32_t), Local&lt;Object&gt; NanNewBufferHandle(uint32_t)\n\nThe `Buffer` API has changed a little in Node 0.11, this helper provides consistent access to `Buffer` creation:\n\n```c++\nNanNewBufferHandle((char*)value.data(), value.size());\n```\n\nCan also be used to initialize a `Buffer` with just a `size` argument.\n\nCan also be supplied with a `NanFreeCallback` and a hint for the garbage collector.\n\n<a name="api_nan_buffer_use"></a>\n### Local&lt;Object&gt; NanBufferUse(char*, uint32_t)\n\n`Buffer::New(char*, uint32_t)` prior to 0.11 would make a copy of the data.\nWhile it was possible to get around this, it required a shim by passing a\ncallback. So the new API `Buffer::Use(char*, uint32_t)` was introduced to remove\nneeding to use this shim.\n\n`NanBufferUse` uses the `char*` passed as the backing data, and will free the\nmemory automatically when the weak callback is called. Keep this in mind, as\ncareless use can lead to "double free or corruption" and other cryptic failures.\n\n<a name="api_nan_has_instance"></a>\n### bool NanHasInstance(Persistent&lt;FunctionTemplate&gt;&, Handle&lt;Value&gt;)\n\nCan be used to check the type of an object to determine it is of a particular class you have already defined and have a `Persistent<FunctionTemplate>` handle for.\n\n<a href="#api_nan_new_context_handle">\n### Local&lt;Context&gt; NanNewContextHandle([ExtensionConfiguration*, Handle&lt;ObjectTemplate&gt;, Handle&lt;Value&gt;])\nCreates a new `Local<Context>` handle.\n\n```c++\nLocal<FunctionTemplate> ftmpl = NanNew<FunctionTemplate>();\nLocal<ObjectTemplate> otmpl = ftmpl->InstanceTemplate();\nLocal<Context> ctx = NanNewContextHandle(NULL, otmpl);\n```\n\n<a href="#api_nan_get_current_context">\n### Local<Context> NanGetCurrentContext()\n\nGets the current context.\n\n```c++\nLocal<Context> ctx = NanGetCurrentContext();\n```\n\n<a name="api_nan_dispose_persistent"></a>\n### void NanDisposePersistent(Persistent&lt;T&gt; &)\n\nUse `NanDisposePersistent` to dispose a `Persistent` handle.\n\n```c++\nNanDisposePersistent(persistentHandle);\n```\n\n<a name="api_nan_assign_persistent"></a>\n### NanAssignPersistent(type, handle, object)\n\nUse `NanAssignPersistent` to assign a non-`Persistent` handle to a `Persistent` one. You can no longer just declare a `Persistent` handle and assign directly to it later, you have to `Reset` it in Node 0.11, so this makes it easier.\n\nIn general it is now better to place anything you want to protect from V8\'s garbage collector as properties of a generic `Object` and then assign that to a `Persistent`. This works in older versions of Node also if you use `NanAssignPersistent`:\n\n```c++\nPersistent<Object> persistentHandle;\n\n...\n\nLocal<Object> obj = NanNew<Object>();\nobj->Set(NanSymbol("key"), keyHandle); // where keyHandle might be a Local<String>\nNanAssignPersistent(Object, persistentHandle, obj)\n```\n\n<a name="api_nan_make_weak_persistent"></a>\n### NanMakeWeakPersistent(Handle&lt;T&gt; handle, P* parameter, _NanWeakCallbackInfo&lt;T, P&gt;::Callback callback)\n\nCreates a weak persistent handle with the supplied parameter and `NAN_WEAK_CALLBACK`. The callback has to be fully specialized to work on all versions of Node.\n\n```c++\nNAN_WEAK_CALLBACK(weakCallback) {\n\n...\n\n}\n\nLocal<Function> func;\n\n...\n\nint *parameter = new int(0);\nNanMakeWeakPersistent(func, parameter, &weakCallback<Function, int>);\n```\n\n<a name="api_nan_set_template"></a>\n### NanSetTemplate(templ, name, value)\n\nUse to add properties on object and function templates.\n\n<a name="api_nan_make_callback"></a>\n### NanMakeCallback(target, func, argc, argv)\n\nUse instead of `node::MakeCallback` to call javascript functions. This is the only proper way of calling functions.\n\n<a name="api_nan_compile_script"></a>\n### NanCompileScript(Handle<String> s [, const ScriptOrigin&amp; origin])\n\nUse to create new scripts bound to the current context.\n\n<a name="api_nan_run_script"></a>\n### NanRunScript(script)\n\nUse to run both bound and unbound scripts.\n\n<a name="api_nan_adjust_external_memory"></a>\n### NanAdjustExternalMemory(int change_in_bytes)\n\nSimply does `AdjustAmountOfExternalAllocatedMemory`\n\n<a name="api_nan_add_gc_epilogue_callback"></a>\n### NanAddGCEpilogueCallback(GCEpilogueCallback callback, GCType gc_type_filter=kGCTypeAll)\n\nSimply does `AddGCEpilogueCallback`\n\n<a name="api_nan_add_gc_prologue_callback"></a>\n### NanAddGCPrologueCallback(GCPrologueCallback callback, GCType gc_type_filter=kGCTypeAll)\n\nSimply does `AddGCPrologueCallback`\n\n<a name="api_nan_remove_gc_epilogue_callback"></a>\n### NanRemoveGCEpilogueCallback(GCEpilogueCallback callback)\n\nSimply does `RemoveGCEpilogueCallback`\n\n<a name="api_nan_add_gc_prologue_callback"></a>\n### NanRemoveGCPrologueCallback(GCPrologueCallback callback)\n\nSimply does `RemoveGCPrologueCallback`\n\n<a name="api_nan_get_heap_statistics"></a>\n### NanGetHeapStatistics(HeapStatistics *heap_statistics)\n\nSimply does `GetHeapStatistics`\n\n<a name="api_nan_callback"></a>\n### NanCallback\n\nBecause of the difficulties imposed by the changes to `Persistent` handles in V8 in Node 0.11, creating `Persistent` versions of your `Handle<Function>` is annoyingly tricky. `NanCallback` makes it easier by taking your handle, making it persistent until the `NanCallback` is deleted and even providing a handy `Call()` method to fetch and execute the callback `Function`.\n\n```c++\nLocal<Function> callbackHandle = args[0].As<Function>();\nNanCallback *callback = new NanCallback(callbackHandle);\n// pass `callback` around and it\'s safe from GC until you:\ndelete callback;\n```\n\nYou can execute the callback like so:\n\n```c++\n// no arguments:\ncallback->Call(0, NULL);\n\n// an error argument:\nHandle<Value> argv[] = {\n NanError(NanNew<String>("fail!"))\n};\ncallback->Call(1, argv);\n\n// a success argument:\nHandle<Value> argv[] = {\n NanNull(),\n NanNew<String>("w00t!")\n};\ncallback->Call(2, argv);\n```\n\n`NanCallback` also has a `Local<Function> GetCallback()` method that you can use\nto fetch a local handle to the underlying callback function, as well as a\n`void SetFunction(Handle<Function>)` for setting the callback on the\n`NanCallback`. Additionally a generic constructor is available for using\n`NanCallback` without performing heap allocations.\n\n<a name="api_nan_async_worker"></a>\n### NanAsyncWorker\n\n`NanAsyncWorker` is an abstract class that you can subclass to have much of the annoying async queuing and handling taken care of for you. It can even store arbitrary V8 objects for you and have them persist while the async work is in progress.\n\nSee a rough outline of the implementation:\n\n```c++\nclass NanAsyncWorker {\npublic:\n NanAsyncWorker (NanCallback *callback);\n\n // Clean up persistent handles and delete the *callback\n virtual ~NanAsyncWorker ();\n\n // Check the `char *errmsg` property and call HandleOKCallback()\n // or HandleErrorCallback depending on whether it has been set or not\n virtual void WorkComplete ();\n\n // You must implement this to do some async work. If there is an\n // error then allocate `errmsg` to a message and the callback will\n // be passed that string in an Error object\n virtual void Execute ();\n\n // Save a V8 object in a Persistent handle to protect it from GC\n void SavePersistent(const char *key, Local<Object> &obj);\n\n // Fetch a stored V8 object (don\'t call from within `Execute()`)\n Local<Object> GetFromPersistent(const char *key);\n\nprotected:\n // Set this if there is an error, otherwise it\'s NULL\n const char *errmsg;\n\n // Default implementation calls the callback function with no arguments.\n // Override this to return meaningful data\n virtual void HandleOKCallback ();\n\n // Default implementation calls the callback function with an Error object\n // wrapping the `errmsg` string\n virtual void HandleErrorCallback ();\n};\n```\n\n<a name="api_nan_async_queue_worker"></a>\n### NanAsyncQueueWorker(NanAsyncWorker *)\n\n`NanAsyncQueueWorker` will run a `NanAsyncWorker` asynchronously via libuv. Both the *execute* and *after_work* steps are taken care of for you&mdash;most of the logic for this is embedded in `NanAsyncWorker`.\n\n### Contributors\n\nNAN is only possible due to the excellent work of the following contributors:\n\n<table><tbody>\n<tr><th align="left">Rod Vagg</th><td><a href="https://github.com/rvagg">GitHub/rvagg</a></td><td><a href="http://twitter.com/rvagg">Twitter/@rvagg</a></td></tr>\n<tr><th align="left">Benjamin Byholm</th><td><a href="https://github.com/kkoopa/">GitHub/kkoopa</a></td></tr>\n<tr><th align="left">Trevor Norris</th><td><a href="https://github.com/trevnorris">GitHub/trevnorris</a></td><td><a href="http://twitter.com/trevnorris">Twitter/@trevnorris</a></td></tr>\n<tr><th align="left">Nathan Rajlich</th><td><a href="https://github.com/TooTallNate">GitHub/TooTallNate</a></td><td><a href="http://twitter.com/TooTallNate">Twitter/@TooTallNate</a></td></tr>\n<tr><th align="left">Brett Lawson</th><td><a href="https://github.com/brett19">GitHub/brett19</a></td><td><a href="http://twitter.com/brett19x">Twitter/@brett19x</a></td></tr>\n<tr><th align="left">Ben Noordhuis</th><td><a href="https://github.com/bnoordhuis">GitHub/bnoordhuis</a></td><td><a href="http://twitter.com/bnoordhuis">Twitter/@bnoordhuis</a></td></tr>\n</tbody></table>\n\nLicence &amp; copyright\n-----------------------\n\nCopyright (c) 2014 NAN contributors (listed above).\n\nNative Abstractions for Node.js is licensed under an MIT +no-false-attribs license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.\n',
140 silly resolved readmeFilename: 'README.md',
140 silly resolved bugs: { url: 'https://github.com/rvagg/nan/issues' },
140 silly resolved homepage: 'https://github.com/rvagg/nan',
140 silly resolved _id: 'nan@1.0.0',
140 silly resolved _shasum: 'ae24f8850818d662fcab5acf7f3b95bfaa2ccf38',
140 silly resolved _from: 'nan@^1.0.0',
140 silly resolved _resolved: 'https://registry.npmjs.org/nan/-/nan-1.0.0.tgz' } ]
141 info install nan@1.0.0 into /vagrant/node_modules/sharp
142 info installOne nan@1.0.0
143 info /vagrant/node_modules/sharp/node_modules/nan unbuild
144 verbose tar unpack /home/vagrant/.npm/nan/1.0.0/package.tgz
145 silly lockFile 4f3b3de1-e-modules-sharp-node-modules-nan tar:///vagrant/node_modules/sharp/node_modules/nan
146 verbose lock tar:///vagrant/node_modules/sharp/node_modules/nan /home/vagrant/.npm/4f3b3de1-e-modules-sharp-node-modules-nan.lock
147 silly lockFile 7c908e99-agrant-npm-nan-1-0-0-package-tgz tar:///home/vagrant/.npm/nan/1.0.0/package.tgz
148 verbose lock tar:///home/vagrant/.npm/nan/1.0.0/package.tgz /home/vagrant/.npm/7c908e99-agrant-npm-nan-1-0-0-package-tgz.lock
149 silly gunzTarPerm modes [ '755', '644' ]
150 silly gunzTarPerm extractEntry package.json
151 silly gunzTarPerm extractEntry README.md
152 silly gunzTarPerm extractEntry LICENSE
153 silly gunzTarPerm extractEntry include_dirs.js
154 silly gunzTarPerm extractEntry .dntrc
155 silly gunzTarPerm extractEntry build/config.gypi
156 silly gunzTarPerm extractEntry nan.h
157 silly lockFile 4f3b3de1-e-modules-sharp-node-modules-nan tar:///vagrant/node_modules/sharp/node_modules/nan
158 silly lockFile 4f3b3de1-e-modules-sharp-node-modules-nan tar:///vagrant/node_modules/sharp/node_modules/nan
159 silly lockFile 7c908e99-agrant-npm-nan-1-0-0-package-tgz tar:///home/vagrant/.npm/nan/1.0.0/package.tgz
160 silly lockFile 7c908e99-agrant-npm-nan-1-0-0-package-tgz tar:///home/vagrant/.npm/nan/1.0.0/package.tgz
161 info preinstall nan@1.0.0
162 verbose readDependencies using package.json deps
163 verbose readDependencies using package.json deps
164 silly resolved []
165 verbose about to build /vagrant/node_modules/sharp/node_modules/nan
166 info build /vagrant/node_modules/sharp/node_modules/nan
167 verbose linkStuff [ false,
167 verbose linkStuff false,
167 verbose linkStuff false,
167 verbose linkStuff '/vagrant/node_modules/sharp/node_modules' ]
168 info linkStuff nan@1.0.0
169 verbose linkBins nan@1.0.0
170 verbose linkMans nan@1.0.0
171 verbose rebuildBundles nan@1.0.0
172 info install nan@1.0.0
173 info postinstall nan@1.0.0
174 verbose about to build /vagrant/node_modules/sharp
175 info build /vagrant/node_modules/sharp
176 verbose linkStuff [ false, false, false, '/vagrant/node_modules' ]
177 info linkStuff sharp@0.4.0
178 verbose linkBins sharp@0.4.0
179 verbose linkMans sharp@0.4.0
180 verbose rebuildBundles sharp@0.4.0
181 verbose rebuildBundles [ 'nan' ]
182 info install sharp@0.4.0
183 verbose unsafe-perm in lifecycle true
184 info sharp@0.4.0 Failed to exec install script
185 info /vagrant/node_modules/sharp unbuild
186 info preuninstall sharp@0.4.0
187 info uninstall sharp@0.4.0
188 verbose true,/vagrant/node_modules,/vagrant/node_modules unbuild sharp@0.4.0
189 info postuninstall sharp@0.4.0
190 error sharp@0.4.0 install: `node-gyp rebuild`
190 error Exit status 1
191 error Failed at the sharp@0.4.0 install script.
191 error This is most likely a problem with the sharp package,
191 error not with npm itself.
191 error Tell the author that this fails on your system:
191 error node-gyp rebuild
191 error You can get their info via:
191 error npm owner ls sharp
191 error There is likely additional logging output above.
192 error System Linux 3.13.0-24-generic
193 error command "/usr/bin/node" "/usr/bin/npm" "install"
194 error cwd /vagrant
195 error node -v v0.10.28
196 error npm -v 1.4.9
197 error code ELIFECYCLE
198 verbose exit [ 1, true ]
{
"name": "sharp-debug",
"version": "0.0.0",
"description": "",
"main": "convert.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"sharp": "^0.4.0"
}
}
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
apt-get update --fix-missing
apt-get install -y python-software-properties curl git build-essential
add-apt-repository -y ppa:chris-lea/node.js
apt-get update
apt-get install -y nodejs libvips-dev
SCRIPT
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty32"
config.vm.provision "shell", inline: $script
end
This file has been truncated, but you can view the full file.
View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment