{"id":13548650,"url":"https://github.com/jsdf/browserify-incremental","last_synced_at":"2025-04-05T11:08:08.735Z","repository":{"id":18370584,"uuid":"21550995","full_name":"jsdf/browserify-incremental","owner":"jsdf","description":"incremental rebuild for browserify","archived":false,"fork":false,"pushed_at":"2019-11-06T16:58:13.000Z","size":43,"stargazers_count":176,"open_issues_count":18,"forks_count":13,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-25T19:42:46.398Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jsdf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-06T23:51:23.000Z","updated_at":"2023-06-01T12:54:22.000Z","dependencies_parsed_at":"2022-07-12T15:14:55.830Z","dependency_job_id":null,"html_url":"https://github.com/jsdf/browserify-incremental","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdf%2Fbrowserify-incremental","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdf%2Fbrowserify-incremental/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdf%2Fbrowserify-incremental/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jsdf%2Fbrowserify-incremental/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jsdf","download_url":"https://codeload.github.com/jsdf/browserify-incremental/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246892816,"owners_count":20850847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T12:01:12.874Z","updated_at":"2025-04-05T11:08:08.717Z","avatar_url":"https://github.com/jsdf.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"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 \u003e 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')\n\nvar b = browserify(Object.assign({}, 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsdf%2Fbrowserify-incremental","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjsdf%2Fbrowserify-incremental","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjsdf%2Fbrowserify-incremental/lists"}