chokidar

Minimal and efficient cross-platform file watching for Node.js.

Library
npm
v6.0.0
12,254 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
75 /100 Good
Development Activity 76
Maintenance 56
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
86 /100 Excellent
Architecture 85
Code Quality 82
Innovation 88
Learning Curve 90

Chokidar is a battle-tested file watching library for Node.js that wraps the native fs.watch and fs.watchFile APIs and normalizes their notoriously inconsistent behavior into a clean, reliable event stream. It reports proper add, change, and unlink events across macOS, Linux, and Windows, handles recursive directory watching, symlinks, atomic saves, and chunked writes, and keeps CPU usage low by preferring event-based watching over polling.

Used in roughly 30 million repositories and depended on by tooling like webpack, Vite, and countless build systems, Chokidar is the de facto standard for watching the filesystem in the Node ecosystem. Version 5 is ESM-only, ships a single runtime dependency, and requires Node.js 20+.

What You Get

  • A single chokidar.watch(paths, options) call that returns an FSWatcher emitting normalized add, addDir, change, unlink, unlinkDir, ready, and error events.
  • Cross-platform consistency that hides the differences between macOS FSEvents, Linux inotify, and Windows watching backends.
  • Recursive directory watching with configurable depth limits, symlink following, and path filtering via functions, regexes, or globs-free matchers.
  • Write-safety options like awaitWriteFinish for chunked writes and atomic handling for editors that save via temp-file swaps.

Common Use Cases

  • Powering hot-reload and live-rebuild in build tools, bundlers, and dev servers.
  • Triggering test re-runs or linting when source files change during development.
  • Syncing, uploading, or reprocessing assets automatically as files are added or modified.
  • Watching configuration or content directories in long-running services and CLIs.

Under The Hood

Architecture — Chokidar is organized around two TypeScript modules. src/index.ts defines the public FSWatcher class (an EventEmitter subclass) plus the watch() factory, owning option normalization, path bookkeeping, throttling, the awaitWriteFinish/atomic write-safety logic, and directory traversal via the readdirp dependency. src/handler.ts holds NodeFsHandler, the low-level bridge that binds fs.watch and fs.watchFile per platform (branching on isWindows, isMacos, isLinux, isIBMi), deduplicates raw OS events, and calls back into the emitter with normalized event names. Events flow from the OS backend in the handler, through stat-based verification, into the throttled emitter surface consumers subscribe to.

Tech Stack — Written in TypeScript (99.7% of the codebase) targeting Node.js 20.19+, compiled with tsc to ESM output. It relies on Node core modules (node:fs, node:fs/promises, node:events, node:path, node:os) and exactly one runtime dependency, readdirp (^5), for recursive directory streaming. Dev tooling is minimal: Prettier for formatting, TypeScript 6, and tinyspy/upath for tests. The package is sideEffects: false and ESM-only.

Code Quality — The code is disciplined and well-typed, using exhaustive const-object event enums, explicit option types (BasicOpts, FSWInstanceOptions), and platform guards rather than ad-hoc checks. It ships a substantial test suite in src/index.test.ts (~110 test cases exercising add/change/unlink flows, symlinks, polling, and write-finish timing) run via node index.test.js. Naming is terse but consistent, and the single-dependency posture reflects deliberate attention to footprint.

API Design — The developer experience is exemplary: a one-liner chokidar.watch('.').on('all', cb) gets you started, while a single options object exposes every advanced knob (ignored, depth, usePolling, awaitWriteFinish, atomic, cwd). The chainable .on() emitter, clearly named events, and thorough README make the surface easy to learn and hard to misuse, which is why it has become the ecosystem default.

Used by 61 apps in this directory

Rust
93%
Other

Tabby

AI Code Assistants

33,924

Self-hosted AI coding assistant — run GitHub Copilot-grade code completion on your own hardware with no cloud dependency.

View details
55
Repo Health
78
Technical
61
Dependency
Built with
Rust 93%
Updated 4 months ago
TypeScript
98%
Apache 2.0

TinaCMS

CMS

13,845

An open-source, Git-backed headless CMS that gives editors a live visual editing UI over Markdown, MDX, JSON, and YAML content while developers keep everything in version control.

View details
92
Repo Health
74
Technical
59
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago
TypeScript
99%
Apache 2.0

Trigger.dev

AI Development · Automation · Developer Tools

16,606

Build and deploy fully-managed AI agents and background jobs in TypeScript — with no timeouts, durable retries, real-time observability, and elastic scaling built in.

View details
90
Repo Health
9
Technical
63
Dependency
Built with
TypeScript 99%
Updated 6 days ago
TypeScript
84%
Other

twenty

CRM

59,615

The open-source CRM you build, ship, and version like the rest of your stack — with customizable objects, AI agents, and a TypeScript SDK.

View details
92
Repo Health
82
Technical
64
Dependency
Built with
TypeScript 84%
MDX 14%
Updated 1 weeks ago
TypeScript
87%
Other

Webiny JS

Blogging · CMS · Ecommerce

8,047

Open-source, self-hosted CMS on AWS serverless — a TypeScript framework you extend with code, not a product you configure through a UI.

View details
90
Repo Health
86
Technical
61
Dependency
Built with
TypeScript 87%
JavaScript 12%
Updated 1 weeks ago
TypeScript
41%
AGPL 3.0

Wiki.js

Collaboration · Knowledge Management

29,081

A modern, self-hosted wiki platform built on Node.js with a rich plugin ecosystem for authentication, search, storage, and rendering that adapts to any team's infrastructure.

View details
95
Repo Health
67
Technical
60
Dependency
Built with
TypeScript 41%
Vue 39%
JavaScript 16%
Updated 6 days ago
TypeScript
72%
AGPL 3.0

Worklenz

Collaboration · Product Management · Project Management

3,259

All-in-one open source project management for teams who want full control — plan projects, track tasks, manage resources, and monitor finances without the SaaS lock-in.

View details
87
Repo Health
7
Technical
64
Dependency
Built with
TypeScript 72%
JavaScript 21%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers