chokidar

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

Library
npm
v5.0.0
12,244 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
59 /100 Fair
Development Activity 40
Maintenance 28
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

TypeScript
100%
Other

Activepieces

AI Assistants · Automation · Mcp

24,756

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
64
Dependency
Built with
TypeScript 100%
Updated 4 days ago
TypeScript
49%
MPL 2.0

Artillery

Developer Tools · Devops

9,083

Cloud-scale load testing and functional testing for APIs, WebSockets, gRPC, and headless browsers, distributed across AWS Lambda or Fargate with zero infrastructure to manage.

View details
89
Repo Health
73
Technical
68
Dependency
Built with
TypeScript 49%
JavaScript 48%
Updated 1 weeks ago
Python
68%
Other

Baserow

Databases · No Code Platforms

6,012

Open-source no-code platform to build databases, apps, automations, and AI agents — self-hosted or cloud, with full data ownership.

View details
89
Repo Health
84
Technical
68
Dependency
Built with
Python 68%
JavaScript 16%
Vue 11%
Updated 5 days ago
TypeScript
70%
Other

Budibase

Low Code Platforms · No Code Platforms

28,324

Build AI agents, automations, and internal apps on a single open-source platform with full self-hosting control.

View details
91
Repo Health
81
Technical
63
Dependency
Built with
TypeScript 70%
Svelte 26%
Updated 1 weeks ago
TypeScript
96%
Other

Cal.diy

Scheduling

48,697

The 100% MIT-licensed, community-driven scheduling platform — self-host your own booking infrastructure with no enterprise strings attached.

View details
91
Repo Health
86
Technical
65
Dependency
Built with
TypeScript 96%
Updated 6 days ago
TypeScript
98%
MIT

Cate

AI Code Assistants

2,162

A desktop IDE built on an infinite canvas — spread code editors, terminals, browsers, docs, and AI agents across freeform space instead of stacking windows and tabs, with layouts restored automatically.

View details
80
Repo Health
71
Technical
72
Dependency
Built with
TypeScript 98%
Updated 5 days ago
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

52,202

All-in-one AI desktop client with 300+ assistants and multi-model support

View details
89
Repo Health
84
Technical
70
Dependency
Built with
TypeScript 99%
Updated 4 days ago
TypeScript
98%
Apache 2.0

Cline

AI Code Assistants

69,455

An open-source AI coding agent that lives in your editor and terminal — reads and edits your codebase, runs commands, browses the web, and requires human approval for every action by default.

View details
90
Repo Health
74
Technical
65
Dependency
Built with
TypeScript 98%
Updated 4 days ago
TypeScript
45%
Other

Convex Backend

Databases · Developer Tools

12,617

Open-source reactive database that lets developers build live-updating apps with pure TypeScript, strong consistency, and real-time subscriptions—no separate API layer required.

View details
87
Repo Health
82
Technical
68
Dependency
Built with
TypeScript 45%
Rust 43%
Updated 6 days 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