{"id":13472342,"url":"https://github.com/open-cli-tools/chokidar-cli","last_synced_at":"2025-05-16T05:00:16.816Z","repository":{"id":30644638,"uuid":"34200213","full_name":"open-cli-tools/chokidar-cli","owner":"open-cli-tools","description":"Fast cross-platform cli utility to watch file system changes","archived":false,"fork":false,"pushed_at":"2024-06-15T14:15:00.000Z","size":239,"stargazers_count":843,"open_issues_count":39,"forks_count":51,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-12T07:21:47.522Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/chokidar-cli","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/open-cli-tools.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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}},"created_at":"2015-04-19T09:09:11.000Z","updated_at":"2025-05-11T01:55:44.000Z","dependencies_parsed_at":"2024-01-03T04:14:28.457Z","dependency_job_id":"332ae28f-285c-4ea1-a19d-03a6f4eedc54","html_url":"https://github.com/open-cli-tools/chokidar-cli","commit_stats":{"total_commits":116,"total_committers":16,"mean_commits":7.25,"dds":0.5172413793103448,"last_synced_commit":"214494a336c49129d8828f22838b7a0b36980c8e"},"previous_names":["open-npm-tools/chokidar-cli"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cli-tools%2Fchokidar-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cli-tools%2Fchokidar-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cli-tools%2Fchokidar-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-cli-tools%2Fchokidar-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-cli-tools","download_url":"https://codeload.github.com/open-cli-tools/chokidar-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471028,"owners_count":22076582,"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-07-31T16:00:53.923Z","updated_at":"2025-05-16T05:00:16.787Z","avatar_url":"https://github.com/open-cli-tools.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Files and Directories","others","\u003ca name=\"file-watch\"\u003e\u003c/a\u003eFile watching for changes"],"sub_categories":["Files"],"readme":"# Chokidar CLI\n\n[![Build Status](https://github.com/open-cli-tools/chokidar-cli/workflows/Tests/badge.svg)](https://github.com/open-cli-tools/chokidar-cli/actions?workflow=Tests)\n\nFast cross-platform command line utility to watch file system changes.\n\nThe underlying watch library is [Chokidar](https://github.com/paulmillr/chokidar), which is one of the best watch utilities for Node. Chokidar is battle-tested:\n\n\u003e It is used in\n\u003e [brunch](http://brunch.io),\n\u003e [gulp](https://github.com/gulpjs/gulp/),\n\u003e [karma](http://karma-runner.github.io),\n\u003e [PM2](https://github.com/Unitech/PM2),\n\u003e [browserify](http://browserify.org/),\n\u003e [webpack](http://webpack.github.io/),\n\u003e [BrowserSync](http://www.browsersync.io/),\n\u003e [socketstream](http://www.socketstream.org),\n\u003e [derby](http://derbyjs.com/),\n\u003e and [many others](https://www.npmjs.org/browse/depended/chokidar/).\n\u003e It has proven itself in production environments.\n\n## Prerequisites\n\n- Node.js v8.10.0 or newer\n\n## Install\n\nIf you need it only with npm scripts:\n\n```bash\nnpm install chokidar-cli\n```\n\nOr globally\n\n```bash\nnpm install -g chokidar-cli\n```\n\n## Usage\n\nChokidar can be invoked using the `chokidar` command, without the `-cli` suffix.\n\nArguments use the form of runtime flags with string parameters, delimited by quotes. While in principal both single and double quotes are supported by `chokidar-cli`, the actual command line argument parsing is dependent on the operating system and shell used; for cross-platform compatibility, use double quotes (with escaping, if necessary), as single quotes are not universally supported by all operating systems.\n\nThis is particularly important when using chokidar-cli for run scripts specified in `package.json`. For maximum platform compatibility, make sure to use escaped double quotes around chokidar's parameters:\n\n```json\n\"run\": {\n  \"chokidar\": \"chokidar \\\"**/*.js\\\" -c \\\"...\\\"\"\n},\n```\n\n## Default behavior\n\nBy default `chokidar` streams changes for all patterns to stdout:\n\n```bash\n$ chokidar \"**/*.js\" \"**/*.less\"\nchange:test/dir/a.js\nchange:test/dir/a.less\nadd:test/b.js\nunlink:test/b.js\n```\n\nEach change is represented with format `event:relativepath`. Possible events: `add`, `unlink`, `addDir`, `unlinkDir`, `change`.\n\n**Output only relative paths on each change**\n\n```bash\n$ chokidar \"**/*.js\" \"**/*.less\" | cut -d \":\" -f 2-\ntest/dir/a.js\ntest/dir/a.less\ntest/b.js\ntest/b.js\n```\n\n**Run *npm run build-js* whenever any .js file changes in the current work directory tree**\n\n```chokidar \"**/*.js\" -c \"npm run build-js\"```\n\n**Watching in network directories must use polling**\n\n```chokidar \"**/*.less\" -c \"npm run build-less\" --polling```\n\n**Pass the path and event details in to your custom command**\n\n```chokidar \"**/*.less\" -c \"if [ '{event}' = 'change' ]; then npm run build-less -- {path}; fi;\"```\n\n**Detailed help**\n\n```\nUsage: chokidar \u003cpattern\u003e [\u003cpattern\u003e...] [options]\n\n\u003cpattern\u003e:\nGlob pattern to specify files to be watched.\nMultiple patterns can be watched by separating patterns with spaces.\nTo prevent shell globbing, write pattern inside quotes.\nGuide to globs: https://github.com/isaacs/node-glob#glob-primer\n\n\nOptions:\n  -c, --command           Command to run after each change. Needs to be\n                          surrounded with quotes when command contains spaces.\n                          Instances of `{path}` or `{event}` within the command\n                          will be replaced by the corresponding values from the\n                          chokidar event.\n  -d, --debounce          Debounce timeout in ms for executing command\n                                                                  [default: 400]\n  -t, --throttle          Throttle timeout in ms for executing command\n                                                                  [default: 0]\n  -s, --follow-symlinks   When not set, only the symlinks themselves will be\n                          watched for changes instead of following the link\n                          references and bubbling events through the links path\n                                                      [boolean] [default: false]\n  -i, --ignore            Pattern for files which should be ignored. Needs to be\n                          surrounded with quotes to prevent shell globbing. The\n                          whole relative or absolute path is tested, not just\n                          filename. Supports glob patterns or regexes using\n                          format: /yourmatch/i\n  --initial               When set, command is initially run once\n                                                      [boolean] [default: false]\n  -p, --polling           Whether to use fs.watchFile(backed by polling) instead\n                          of fs.watch. This might lead to high CPU utilization.\n                          It is typically necessary to set this to true to\n                          successfully watch files over a network, and it may be\n                          necessary to successfully watch files in other non-\n                          standard situations         [boolean] [default: false]\n  --poll-interval         Interval of file system polling. Effective when --\n                          polling is set                          [default: 100]\n  --poll-interval-binary  Interval of file system polling for binary files.\n                          Effective when --polling is set         [default: 300]\n  --verbose               When set, output is more verbose and human readable.\n                                                      [boolean] [default: false]\n  --silent                When set, internal messages of chokidar-cli won't be\n                          written.                    [boolean] [default: false]\n  -h, --help              Show help                                    [boolean]\n  -v, --version           Show version number                          [boolean]\n\nExamples:\n  chokidar \"**/*.js\" -c \"npm run build-js\"  build when any .js file changes\n  chokidar \"**/*.js\" \"**/*.less\"            output changes of .js and .less\n                                            files\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-cli-tools%2Fchokidar-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-cli-tools%2Fchokidar-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-cli-tools%2Fchokidar-cli/lists"}