{"id":13555924,"url":"https://github.com/browserify/watchify","last_synced_at":"2026-03-17T20:02:38.431Z","repository":{"id":8710951,"uuid":"10379106","full_name":"browserify/watchify","owner":"browserify","description":"watch mode for browserify builds","archived":false,"fork":false,"pushed_at":"2024-12-21T09:59:06.000Z","size":173,"stargazers_count":1791,"open_issues_count":38,"forks_count":178,"subscribers_count":18,"default_branch":"master","last_synced_at":"2026-02-22T08:29:21.967Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/browserify.png","metadata":{"files":{"readme":"readme.markdown","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-05-30T08:55:38.000Z","updated_at":"2026-02-18T04:36:02.000Z","dependencies_parsed_at":"2025-04-10T16:19:46.923Z","dependency_job_id":"0d1c12b6-c2dc-464a-b770-efb2f685d90d","html_url":"https://github.com/browserify/watchify","commit_stats":null,"previous_names":["substack/watchify"],"tags_count":70,"template":false,"template_full_name":null,"purl":"pkg:github/browserify/watchify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fwatchify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fwatchify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fwatchify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fwatchify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/browserify","download_url":"https://codeload.github.com/browserify/watchify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Fwatchify/sbom","scorecard":{"id":254793,"data":{"date":"2025-08-11","repo":{"name":"github.com/browserify/watchify","commit":"7b27a3c0d6bb796cef71faebfeb610ec62ad97b3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":3,"reason":"Found 9/24 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/browserify/watchify/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/browserify/watchify/ci.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:21","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/browserify/.github/SECURITY.md:1","Info: Found linked content: github.com/browserify/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/browserify/.github/SECURITY.md:1","Info: Found text in security policy: github.com/browserify/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 19 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T09:23:03.831Z","repository_id":8710951,"created_at":"2025-08-17T09:23:03.832Z","updated_at":"2025-08-17T09:23:03.832Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29711634,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T10:34:24.778Z","status":"ssl_error","status_checked_at":"2026-02-22T10:32:23.200Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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:03:30.491Z","updated_at":"2026-03-17T20:02:38.405Z","avatar_url":"https://github.com/browserify.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","others"],"sub_categories":[],"readme":"# watchify\n\nwatch mode for [browserify](https://github.com/substack/node-browserify) builds\n\n[![build status](https://secure.travis-ci.org/browserify/watchify.svg?branch=master)](http://travis-ci.org/browserify/watchify)\n\nUpdate any source file and your browserify bundle will be recompiled on the\nspot.\n\n# example\n\n```\n$ watchify main.js -o static/bundle.js\n```\n\nNow as you update files, `static/bundle.js` will be automatically\nincrementally rebuilt on the fly.\n\nThe `-o` option can be a file or a shell command (not available on Windows)\nthat receives piped input:\n\n``` sh\nwatchify main.js -o 'exorcist static/bundle.js.map \u003e static/bundle.js' -d\n```\n\n``` sh\nwatchify main.js -o 'uglifyjs -cm \u003e static/bundle.min.js'\n```\n\nYou can use `-v` to get more verbose output to show when a file was written and how long the bundling took (in seconds):\n\n```\n$ watchify browser.js -d -o static/bundle.js -v\n610598 bytes written to static/bundle.js (0.23 seconds) at 8:31:25 PM\n610606 bytes written to static/bundle.js (0.10 seconds) at 8:45:59 PM\n610597 bytes written to static/bundle.js (0.14 seconds) at 8:46:02 PM\n610606 bytes written to static/bundle.js (0.08 seconds) at 8:50:13 PM\n610597 bytes written to static/bundle.js (0.08 seconds) at 8:58:16 PM\n610597 bytes written to static/bundle.js (0.19 seconds) at 9:10:45 PM\n```\n\n# usage\n\nUse `watchify` with all the same options as `browserify` except that `-o` (or\n`--outfile`) is mandatory. Additionally, there are also:\n\n```\nStandard Options:\n\n  --outfile=FILE, -o FILE\n\n    This option is required. Write the browserify bundle to this file. If\n    the file contains the operators `|` or `\u003e`, it will be treated as a\n    shell command, and the output will be piped to it.\n\n  --verbose, -v                     [default: false]\n\n    Show when a file was written and how long the bundling took (in\n    seconds).\n\n  --version\n\n    Show the watchify and browserify versions with their module paths.\n```\n\n```\nAdvanced Options:\n\n  --delay                           [default: 100]\n\n    Amount of time in milliseconds to wait before emitting an \"update\"\n    event after a change.\n\n  --ignore-watch=GLOB, --iw GLOB    [default: false]\n\n    Ignore monitoring files for changes that match the pattern. Omitting\n    the pattern will default to \"**/node_modules/**\".\n\n  --poll=INTERVAL                   [default: false]\n\n    Use polling to monitor for changes. Omitting the interval will default\n    to 100ms. This option is useful if you're watching an NFS volume.\n```\n\n# methods\n\n``` js\nvar watchify = require('watchify');\n```\n\n## watchify(b, opts)\n\nwatchify is a browserify [plugin](https://github.com/browserify/browserify#bpluginplugin-opts), so it can be applied like any other plugin.\nHowever, when creating the browserify instance `b`, **you MUST set the `cache`\nand `packageCache` properties**:\n\n``` js\nvar b = browserify({ cache: {}, packageCache: {} });\nb.plugin(watchify);\n```\n\n```js\nvar b = browserify({\n  cache: {},\n  packageCache: {},\n  plugin: [watchify]\n});\n```\n\n**By default, watchify doesn't display any output, see [events](https://github.com/browserify/watchify#events) for more info.**\n\n`b` continues to behave like a browserify instance except that it caches file\ncontents and emits an `'update'` event when a file changes. You should call\n`b.bundle()` after the `'update'` event fires to generate a new bundle.\nCalling `b.bundle()` extra times past the first time will be much faster due\nto caching.\n\n**Important:** Watchify will not emit `'update'` events until you've called\n`b.bundle()` once and completely drained the stream it returns.\n\n```js\nvar fs = require('fs');\nvar browserify = require('browserify');\nvar watchify = require('watchify');\n\nvar b = browserify({\n  entries: ['path/to/entry.js'],\n  cache: {},\n  packageCache: {},\n  plugin: [watchify]\n});\n\nb.on('update', bundle);\nbundle();\n\nfunction bundle() {\n  b.bundle()\n    .on('error', console.error)\n    .pipe(fs.createWriteStream('output.js'))\n  ;\n}\n```\n\n### options\n\nYou can to pass an additional options object as a second parameter of\nwatchify. Its properties are:\n\n`opts.delay` is the amount of time in milliseconds to wait before emitting\nan \"update\" event after a change. Defaults to `100`.\n\n`opts.ignoreWatch` ignores monitoring files for changes. If set to `true`,\nthen `**/node_modules/**` will be ignored. For other possible values see\nChokidar's [documentation](https://github.com/paulmillr/chokidar#path-filtering) on \"ignored\".\n\n`opts.poll` enables polling to monitor for changes. If set to `true`, then\na polling interval of 100ms is used. If set to a number, then that amount of\nmilliseconds will be the polling interval. For more info see Chokidar's\n[documentation](https://github.com/paulmillr/chokidar#performance) on\n\"usePolling\" and \"interval\".\n**This option is useful if you're watching an NFS volume.**\n\n```js\nvar b = browserify({ cache: {}, packageCache: {} });\n// watchify defaults:\nb.plugin(watchify, {\n  delay: 100,\n  ignoreWatch: ['**/node_modules/**'],\n  poll: false\n});\n```\n\n## b.close()\n\nClose all the open watch handles.\n\n# events\n\n## b.on('update', function (ids) {})\n\nWhen the bundle changes, emit the array of bundle `ids` that changed.\n\n## b.on('bytes', function (bytes) {})\n\nWhen a bundle is generated, this event fires with the number of bytes.\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 after a bundle was created 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# working with browserify transforms\n\nIf your custom transform for browserify adds new files to the bundle in a non-standard way without requiring.\nYou can inform Watchify about these files by emiting a 'file' event.\n\n```\nmodule.exports = function(file) {\n  return through(\n    function(buf, enc, next) {\n      /*\n        manipulating file content\n      */\n      \n      this.emit(\"file\", absolutePathToFileThatHasToBeWatched);\n      \n      next();\n    }\n  );\n};\n```\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\n$ npm install -g watchify\n```\n\nto get the watchify command and:\n\n```\n$ npm install watchify\n```\n\nto get just the library.\n\n# troubleshooting\n\n## rebuilds on OS X never trigger\n\nIt may be related to a bug in `fsevents` (see [#250](https://github.com/browserify/watchify/issues/205#issuecomment-98672850)\nand [stackoverflow](http://stackoverflow.com/questions/26708205/webpack-watch-isnt-compiling-changed-files/28610124#28610124)).\nTry the `--poll` flag\nand/or renaming the project's directory - that might help.\n\n## watchify swallows errors\n\nTo ensure errors are reported you have to add a event listener to your bundle stream. For more information see ([browserify/browserify#1487 (comment)](https://github.com/browserify/browserify/issues/1487#issuecomment-173357516) and [stackoverflow](https://stackoverflow.com/a/22389498/1423220))\n\n**Example:**\n```\nvar b = browserify();\nb.bundle()\n  .on('error', console.error)\n   ...\n;\n```\n\n# see also\n\n- [budo](https://www.npmjs.com/package/budo) – a simple development server built on watchify\n- [errorify](https://www.npmjs.com/package/errorify) – a plugin to add error handling to watchify development\n- [watchify-request](https://www.npmjs.com/package/watchify-request) – wraps a `watchify` instance to avoid stale bundles in HTTP requests\n- [watchify-middleware](https://www.npmjs.com/package/watchify-middleware) – similar to `watchify-request`, but includes some higher-level features\n\n# license\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserify%2Fwatchify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrowserify%2Fwatchify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserify%2Fwatchify/lists"}