Chokidar is a file watching library for Node.js that provides cross-platform filesystem event monitoring with a normalized, reliable API.
The core problem it solves is that Node.js's built-in fs.watch and fs.watchFile have inconsistent behavior across platforms and report events unreliably. Chokidar wraps these APIs and normalizes the output by validating events through file stats and directory contents checks, ensuring that changes are reported consistently as add, change, or unlink events rather than the ambiguous rename events that raw fs.watch produces. It handles edge cases like atomic writes and chunked file writes through configurable options, supports symbolic links, enables recursive watching across all platforms, and allows filtering files and directories during the watch process.
Developers should choose this tool if they need reliable file watching in production environments where event accuracy matters. It suits projects that monitor filesystem changes for build systems, development servers, or file synchronization tasks. The library is minimal in scope—it focuses purely on watching and event normalization without including glob pattern matching, which was removed in recent versions to reduce dependencies. For projects that need glob support, that functionality must be handled separately.
The project maintains active development with significant recent refactoring. Version 5 transitioned the package to ESM-only and raised the minimum Node.js requirement to version 20. Version 4 substantially reduced the dependency count from thirteen to one while adding support for both ESM and CommonJS modules and raising the minimum Node.js version from 8 to 14. The library has been in production use across millions of repositories since its creation, demonstrating sustained reliability and adoption at scale.