Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chokidar-cli

Package Overview
Dependencies
Maintainers
3
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chokidar-cli

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

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
271K
increased by6.48%
Maintainers
3
Weekly downloads
 
Created

What is chokidar-cli?

chokidar-cli is a command-line interface for the Chokidar file watcher library. It allows you to watch files and directories for changes and execute commands in response to those changes. This is particularly useful for automating tasks such as building, testing, or deploying code when files are modified.

What are chokidar-cli's main functionalities?

Watch a directory and run a command on change

This feature allows you to watch all JavaScript files in a directory and run a specified command whenever any of those files change. In this example, the 'npm run build' command will be executed whenever a .js file is modified.

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

Watch multiple directories

You can watch multiple directories and run a command when any file in those directories changes. In this example, both the 'src' and 'test' directories are being watched, and the 'npm test' command will be executed on any change.

chokidar 'src/**/*.js' 'test/**/*.js' -c 'npm test'

Ignore specific files or directories

This feature allows you to ignore specific files or directories while watching for changes. In this example, all JavaScript files are being watched except those in the 'node_modules' directory, and the 'npm run lint' command will be executed on any change.

chokidar '**/*.js' -i 'node_modules' -c 'npm run lint'

Run a command only once after multiple changes

This feature allows you to debounce the execution of a command, meaning the command will only run once after a series of changes within a specified time frame. In this example, the 'npm run build' command will be executed 500 milliseconds after the last change.

chokidar '**/*.js' -c 'npm run build' --debounce 500

Other packages similar to chokidar-cli

Keywords

FAQs

Package last updated on 27 Jul 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc