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

chokidar

Package Overview
Dependencies
Maintainers
1
Versions
107
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chokidar

Minimal and efficient cross-platform file watching library

  • 4.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
58M
increased by0.42%
Maintainers
1
Weekly downloads
 
Created

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

Package last updated on 16 Dec 2024

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