JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 419696
  • Score
    100M100P100Q171071F
  • License MIT

Ultra-fast cross-platform command line utility to watch file system changes.

Package Exports

  • chokidar-cli
  • chokidar-cli/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (chokidar-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Chokidar CLI

Build Status

Ultra-fast cross-platform command line utility to watch file system changes.

The underlying watch library is Chokidar, which is one of the best watch utilities for Node. Chokidar is battle-tested:

It is used in brunch, karma, PM2, browserify, webpack, BrowserSync, socketstream, derby, and many others. It has proven itself in production environments.

Install

If you need it only with NPM scripts:

npm install chokidar-cli

Or globally

npm install -g chokidar-cli

Usage

Run npm run build-js whenever any .js file changes in the current work directory tree

chokidar '**/*.js' 'npm run build-js'

Watching in network directories must use polling

chokidar '**/*.less' 'npm run build-less' --polling

Detailed help

Usage: chokidar <pattern> <command> [options]

<pattern>:
Glob pattern to specify files to be watched.
Needs to be surrounded with quotes to prevent shell globbing.
Guide to globs: https://github.com/isaacs/node-glob#glob-primer

<command>:
Command to be executed when a change is detected.
Needs to be surrounded with quotes when command contains spaces

Options:
  -d, --debounce          Debounce timeout in ms for executing command
                                                                  [default: 400]
  -s, --follow-symlinks   When not set, only the symlinks themselves will be
                          watched for changes instead of following the link
                          references and bubbling events through the links path
                                                     [boolean]  [default: false]
  -i, --ignore            Pattern for files which should be ignored. Needs to
                          be surrounded with quotes to prevent shell globbing.
                          The whole relative or absolute path is tested, not
                          just filename
  --initial               When set, command is initially run once
                                                     [boolean]  [default: false]
  -p, --polling           Whether to use fs.watchFile(backed by polling)
                          instead of fs.watch. This might lead to high CPU
                          utilization. It is typically necessary to set this to
                          true to successfully watch files over a network, and
                          it may be necessary to successfully watch files in
                          other non-standard situations
                                                     [boolean]  [default: false]
  --poll-interval         Interval of file system polling. Effective when
                          --polling is set                        [default: 100]
  --poll-interval-binary  Interval of file system polling for binary files.
                          Effective when --polling is set         [default: 300]
  --verbose               When set, output is more verbose
                                                     [boolean]  [default: false]
  -h, --help              Show help
  -v, --version           Show version number

Examples:
  chokidar "**/*.js" "npm run build-js"    build when any .js file changes

License

MIT