Socket
Socket
Sign inDemoInstall

chokidar

Package Overview
Dependencies
118
Maintainers
2
Versions
104
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    chokidar

A neat wrapper around node.js fs.watch / fs.watchFile / fsevents.


Version published
Weekly downloads
48M
decreased by-1.02%
Maintainers
2
Install size
3.04 MB
Created
Weekly downloads
 

Package description

What is chokidar?

The chokidar npm package is a file watching library that provides an efficient way to watch files and directories for changes. It is built on top of Node.js's native 'fs' module and uses native file system events where possible, but can also fall back to polling if necessary. It is designed to be cross-platform and works on macOS, Windows, and Linux.

What are chokidar's main functionalities?

File Watching

This feature allows you to watch files and directories for changes. The 'add' event is emitted when a file is added to the watched directory, 'change' when a file is changed, and 'unlink' when a file is removed.

const chokidar = require('chokidar');

const watcher = chokidar.watch('/path/to/dir', {ignored: /(^|[\/\\])\../});

watcher.on('add', path => console.log(`File ${path} has been added`));
watcher.on('change', path => console.log(`File ${path} has been changed`));
watcher.on('unlink', path => console.log(`File ${path} has been removed`));

Directory Watching

const chokidar = require('chokidar');

const watcher = chokidar.watch('/path/to/dir', {ignored: /^\
0

Keywords

FAQs

Last updated on 07 Jun 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc