paulmillr

paulmillr/chokidar

TypeScript MIT Dev Tools

Minimal and efficient cross-platform file watching library

12.2k stars
630 forks
active
GitHub +9 / week

12.2k

Stars

630

Forks

43

Open issues

30

Contributors

5.0.0 25 Nov 2025

AI Analysis

Chokidar is a minimal, efficient cross-platform file watching library for Node.js that normalizes filesystem events across macOS, Linux, and Windows. It serves developers building build tools, dev servers, and file-watching applications who need reliable file change detection without the quirks of native fs.watch. It is not a general-purpose application but a foundational library used by millions of repositories.

Dev Tools Library Discovery value: 2/10
Documentation 9/10
Activity 9/10
Community 9/10
Code quality 7/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 9/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

file-watching cross-platform nodejs filesystem-events dev-tools
Actively maintained Well documented MIT licensed Popular Beginner friendly Production ready
Deep Analysis · Based on README and public signals
3w ago

Chokidar: The de facto Node.js file watcher powering ~30 million repositories

Chokidar is a cross-platform file watching library for Node.js that normalizes and enriches the raw, unreliable events emitted by Node's built-in fs.watch and fs.watchFile APIs. It handles edge cases like atomic writes, chunked writes, recursive watching, symbolic links, and filename reporting on macOS — things the native API gets wrong or omits. Built originally for the Brunch build tool in 2012, it became a transitive dependency for Webpack, Vite, Jest, Parcel, and dozens of other foundational JavaScript tooling projects. Its audience is effectively every JavaScript developer using a build tool or dev server.

Origin

Created in April 2012 by Paul Miller for the Brunch build tool, Chokidar filled a gap in Node.js's unreliable native fs.watch API. It grew primarily through transitive adoption by major build tools and bundlers rather than direct installation.

Growth

Growth was largely organic and transitive: as Webpack, Grunt, Gulp, Jest, and later Vite adopted Chokidar, it became embedded in the Node.js tooling supply chain. The v4 release (Sep 2024) dramatically reduced dependencies from 13 to 1, and v5 (Nov 2025) went ESM-only with Node 20 minimum, signaling a deliberate modernization push rather than coasting on legacy status. Star growth has plateaued (5 stars/week) because saturation is near-total in the Node.js tooling space.

In production

README claims ~30 million dependent repositories on npm, which is verifiable via npm's dependency graph. Vite, Webpack, Jest, Parcel, and Brunch are known transitive dependents. npm weekly download badges are displayed prominently. At this scale, the project is a critical piece of Node.js infrastructure with production validation at massive scale.

Code analysis
Architecture

Appears to use Node.js fs.watch as the default backend with polling (fs.watchFile) as fallback. Likely wraps OS-level inotify/FSEvents/ReadDirectoryChangesW through Node.js core rather than native bindings, which explains the single remaining dependency count after v4. Event normalization, debouncing, and recursive traversal are handled in userland TypeScript code based on README descriptions.

Tests

Not documented in README

Maintenance

Last push was May 12, 2026 — approximately 40 days before evaluation date, indicating active maintenance. Two major versions shipped within 14 months (v4 in Sep 2024, v5 in Nov 2025), showing deliberate stewardship. The dependency reduction from 13 to 1 is a concrete maintenance improvement. Repository activity appears healthy, not just passive.

Honest verdict

ADOPT IF: you are building Node.js tooling, dev servers, build pipelines, or any application that needs reliable cross-platform file change detection — this is the established standard with massive production validation. AVOID IF: you need a language-agnostic CLI watcher (use fswatch/watchman) or you require extremely high performance at the OS level for millions of files (consider Watchman directly). MONITOR IF: you maintain a large Node.js project currently on v3 — the v4/v5 breaking changes (glob removal, ESM-only) may require migration planning.

Independent dimensions

Mainstream potential

6/10

Technical importance

8/10

Adoption evidence

10/10

Risks
  • v5's ESM-only stance and Node 20 minimum creates a migration burden for projects on older toolchains or CommonJS-only environments, potentially driving some users to fork or pin v4.
  • Removal of glob support in v4 is a breaking API change that may affect users who relied on glob patterns for path filtering, requiring them to rewrite watch configurations.
  • Relies entirely on Node.js's own fs.watch/fs.watchFile which have known platform-specific quirks (especially on networked filesystems, Docker volumes, and WSL); Chokidar normalizes but cannot fully fix kernel-level limitations.
  • Single maintainer stewardship (paulmillr) creates bus-factor risk for a project that is critical infrastructure for tens of millions of repositories.
  • The polling fallback (usePolling) can cause significant CPU overhead in environments without native OS events (e.g., some CI containers, network mounts), which may surprise users unfamiliar with the underlying behavior.
Prediction

Chokidar is likely to remain the default file watcher in the Node.js ecosystem for the foreseeable future due to deep transitive embedding. The ESM modernization path positions it well for the next several years of Node.js evolution.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

TypeScript
99.7%
JavaScript
0.3%

Information

Language
TypeScript
License
MIT
Last updated
3d ago
Created
173mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Similar repos

emcrisostomo

emcrisostomo/fswatch

fswatch is a cross-platform file change monitor that detects and reports...

5.6k C++ Dev Tools
facebook

facebook/watchman

Watchman is a file watching service maintained by Meta that monitors files and...

13.6k C++ Dev Tools
notify-rs

notify-rs/notify

Notify is a cross-platform filesystem event monitoring library for Rust that...

3.4k Rust Dev Tools
gorakhargosh

gorakhargosh/watchdog

Watchdog is a mature Python library and CLI tool for monitoring filesystem...

7.4k Python Dev Tools
fsnotify

fsnotify/fsnotify

fsnotify is a Go library providing cross-platform filesystem event...

10.7k Go Dev Tools
vs. alternatives
facebook/watchman

Watchman is a standalone daemon written in C++ with a client-server architecture offering higher performance at scale. It's used by Meta's internal tooling and React Native CLI, but requires a separate installation and is overkill for most Node.js projects. Chokidar is zero-friction by comparison.

emcrisostomo/fswatch

fswatch is a CLI/C++ library suited for shell scripting and non-Node environments. It has no npm integration, making it irrelevant for the Node.js tooling use case Chokidar dominates.

fsnotify/fsnotify

fsnotify is the Go ecosystem's equivalent — serves the same niche for Go tooling (used in Hugo, etc.) as Chokidar does for Node.js. They don't compete; they're language-ecosystem counterparts.

gorakhargosh/watchdog

Python ecosystem equivalent. Similar positioning — cross-platform file watching for Python tooling. No overlap with Chokidar's JavaScript target.

Node.js fs.watch (built-in)

The baseline that Chokidar improves upon. fs.watch is unreliable across platforms (no filenames on macOS, duplicate events, no recursive watching on Linux). Chokidar's entire value proposition is the normalization layer on top of it.