{"name":"browserify-incremental","version":"0.1.3","description":"Incremental rebuild for browserify","main":"index.js","bin":{"browserifyinc":"./bin/cmd.js"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"author":{"name":"James Friend","email":"james@jsdf.co","url":"http://jsdf.co/"},"license":"MIT","homepage":"https://github.com/jsdf/browserify-incremental","bugs":{"url":"https://github.com/jsdf/browserify-incremental/issues"},"repository":{"type":"git","url":"git://github.com/jsdf/browserify-incremental.git"},"dependencies":{"browserify":"4.x","through":"^2.3.4","async":"^0.9.0","browserify-cache-api":"^0.1.2"},"_id":"browserify-incremental@0.1.3","dist":{"shasum":"e237ef3fc24fc46a9cbbd41d678a57fe6d7ac775","tarball":"http://registry-npm.ywwl.com/browserify-incremental/download/browserify-incremental-0.1.3.tgz","integrity":"sha512-6RjDAl8p+aLd1bCQwQNlgyuIDFoIeXIBLrvYyvMB6BkAv81rpRq040IGVc/ANqryqu21wQ7JvhE04l0Wp3+jxw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8W/KLiHr1Z0oXlFC1GeCq10uOxcUgxc+umXrJv6ZPhwIhAMYrDiaM7CuHMsMtmOP7ivCrjmi6xJeZX8CmO9ElJ1S0"}],"size":3577,"noattachment":false,"key":"/browserify-incremental/-/browserify-incremental-0.1.3.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"jsdf","email":"james@jsdf.co"},"maintainers":[{"name":"jsdf","email":"james@jsdf.co"}],"directories":{},"readme":"# browserify-incremental\n\nIncremental rebuild for browserify\n\nUpdate any source file and re-bundle, and only changed files will be parsed,\nso it will build super fast (even with big dependencies like React!).\n\n\n## How is this different from [watchify](https://github.com/substack/watchify)?\n\nbrowserify-incremental can detect changes which occured in between runs, which\nmeans it can be used as part of build systems which are invoked on demand,\nwithout requiring a long lived process. Whereas watchify is slow for the first\nrun upon each startup, browserify-incremental is fast every time after the very\nfirst.\n\n\n# example\n\nUse `browserifyinc` with all the same arguments as `browserify`, with the added\n`--cachefile` argument specifying where to put the cache file:\n\n```\n$ browserifyinc -r react -o output/bundle.js  -v\n556200 bytes written to output/bundle.js (1.38 seconds)\n$ browserifyinc -r react -o output/bundle.js  -v\n556200 bytes written to output/bundle.js (0.13 seconds)\n```\n\nNow if you change some files and rebuild, only the changed files will be parsed\nand the rest will reuse the previous build's cached output.\n\nYou can use `-v`/`--verbose` to get more verbose output to show which files have\nchanged and how long the bundling took:\n\n```\n$ browserifyinc test-module/ -v -o output/bundle.js\nchanged files:\n/Users/jfriend/code/browserify-incremental/example/test-module/index.js\n1000423 bytes written to output/bundle.js (0.18 seconds)\n```\n\nIf you don't specify `--cachefile`, a `browserify-cache.json` file will be\ncreated in the current working directory.\n\n# usage\n\n# CLI\n\n```\nbrowserifyinc --cachefile tmp/browserify-cache.json main.js > output.js\n```\n\nAll the bundle options are the same as the browserify command except for `-v`\nand `--cachefile`.\n\n# API\n\n``` js\nvar browserifyInc = require('browserify-incremental')\n```\n\n## var b = browserifyInc(opts)\n\nCreate a browserify bundle `b` from `opts`.\n\n`b` is exactly like a browserify bundle except that it caches file contents and\ncalling `b.bundle()` extra times past the first time will be much faster\ndue to that caching.\n\nBy default, when used via API, browserify-incremental will only use in-memory\ncaching, however you can pass a `cacheFile` option which will use an on disk\ncache instead (useful for build scripts which run once and exit).\n\nYou can also pass in a browserify instance of your own, and that will be used\ninstead of creating a new one, however when you create your browserify instance\nyou must include the following options:\n\n```js\n{cache: {}, packageCache: {}, fullPaths: true}\n```\n\nFor convenience, these options are available as `browserifyInc.args`, so you can\nuse them like:\n\n```js\nvar browserify = require('browserify')\nvar browserifyInc = require('browserify-incremental')\nvar xtend = require('xtend')\n\nvar b = browserify(xtend(browserifyInc.args, {\n  // your custom opts\n}))\nbrowserifyInc(b, {cacheFile: './browserify-cache.json'})\n\nb.bundle().pipe(process.stdout)\n```\n\nThe `cacheFile` opt can be passed to either the browserify or browserify-incremental\nconstructor.\n\n# events\n\n## b.on('bytes', function (bytes) {})\n\nWhen a bundle is generated, this event fires with the number of bytes written.\n\n## b.on('time', function (time) {})\n\nWhen a bundle is generated, this event fires with the time it took to create the\nbundle in milliseconds.\n\n## b.on('log', function (msg) {})\n\nThis event fires to with messages of the form:\n\n```\nX bytes written (Y seconds)\n```\n\nwith the number of bytes in the bundle X and the time in seconds Y.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\n$ npm install -g browserify-incremental browserify\n```\n\nto get the browserifyinc command and:\n\n```\n$ npm install --save browserify-incremental browserify\n```\n\nto get just the library.\n\n## Contributing\n\nPlease see the [Contributor Guidelines](CONTRIBUTING.md).\n\n# license\n\nMIT\n","publish_time":1413160515659,"_cnpm_publish_time":1413160515659,"dist-tags":{"latest":"3.1.1"}}