NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm, #859 most downloaded on npm
Wrapper library for directory and file watching.
Latest stable
2.6.4
Last release 15 days ago
07 Nov 2026
Release timing varies
gaps range from 2 weeks to 1.8 years
Most releases are documented
notes for 30 of 50 stable releases
Nothing withdrawn
no release was ever pulled
12 years old
66 releases · first in 2014
Drag across the ruler to compare, or tap a release to open it.
Keep globToRegExp output a valid, fast regexp for unbalanced brackets, braces and many /. (by @alexander-akait in #370)
Keep globToRegExp output a valid, fast regexp for unbalanced brackets, braces and many **/. (by @alexander-akait in #370)
globToRegExp checks that its output compiles without building a regular expression, which makes it about five times faster. (by @alexander-akait in #372)
Report a watched missing directory that appeared while the previous watcher was paused (e.g. during a webpack build) to the watcher that replaces it,
node_modules directory created during a build could be missed until the next unrelated change, most often with polling. (by @alexander-akait in #361)Your coding agent can read these notes before it upgrades. Set up the MCP server →
On case-insensitive file systems, give a file watched with other casing (e.g. imported as ./B while the file is b.js) the time info of the file instea
On case-insensitive file systems, give a file watched with other casing (e.g. imported as ./B while the file is b.js) the time info of the file instead of null, so webpack rebuilds it on every change, not only the first (fixes #228). (by @alexander-akait in #358)
fix: do not report directories created shortly before startTime as changed when the initial scan sees only directories (#295). (by @alexander-akait in #350)
Timestamp accuracy was learned only from file mtimes, so a scan that found only directories kept the 2000ms default and flagged anything created in the 2s before startTime. Directory mtimes now lower it the same way.
Report changes and removals macOS loses when a directory watcher starts or stops, by rescanning the watched directories once its event stream restarts. (by @alexander-akait in #354)
Watch a missing file whose parent path is a file (e.g. src/foo/index.js, tried by a resolver alias, while src/foo is a file) like one whose parent is missing: no more ENOTDIR "Watchpack Error (initial scan)" log, and the file is reported once the parent becomes a directory (fixes #226's case). (by @alexander-akait in #360)
When the system runs out of file watchers (ENOSPC/EMFILE, e.g. fs.inotify.max_user_watches on Linux), poll the directories it cannot watch instead of reporting their files as removed and retrying in a loop, and log the error once with a hint (fixes #46). (by @alexander-akait in #359)
fix: stop a tight fs.watch retry loop behind a dangling directory symlink, and retry once a second until its target appears. (by @alexander-akait in #
fs.watch retry loop behind a dangling directory symlink, and retry once a second until its target appears. (by @alexander-akait in #346)feat: allow the ignored option to be a mixed array of glob strings and (by @stormslowly in https://github.com/webpack/watchpack/pull/336) RegExp insta
v2.6.0
Minor Changes
feat: allow the ignored option to be a mixed array of glob strings and (by @stormslowly in https://github.com/webpack/watchpack/pull/336) RegExp instances, e.g. ignored: ["**/.cache", /generated/].
Previously an array was assumed to contain only glob strings, so passing a RegExp inside it threw TypeError: Expected a string. This made it awkward for frameworks to append their own glob ignores to a user-supplied RegExp ignore, since the two could not be combined in one value.
Glob strings in the array are still merged into a single RegExp; RegExp items are tested as-is. Behaviour for string-only arrays, single strings, single RegExps and functions is unchanged.
Patch Changes
fix: report a file removed after startTime to a watcher attached later, as a change after startTime already is. (by @alexander-akait in https://github.com/webpack/watchpack/pull/345)
Previously a watcher attached with a startTime learned of files changed since then ("outdated on attach") but not of files removed since then, so webpack missed a dependency deleted while a build ran.
Suppress Watchpack Error (stats) logging for EACCES, ENODEV, and Windows EINVAL lstat errors in the watch-event path, matching the handling in the scan paths (e.g. pagefile.sys on a watched drive root with Node >= 22.17) (by @danielroe in https://github.com/webpack/watchpack/pull/326)
fix: retry fs.lstat on transient EBUSY errors instead of emitting a spurious remove event (fixes #223, #44). The retry count is controlled by the WATC
fix: retry fs.lstat on transient EBUSY errors instead of emitting a spurious remove event (fixes #223, #44). The retry count is controlled by the WATCHPACK_RETRIES environment variable (default: 3; set to 0 or "false" to disable retrying). (by @alexander-akait in #293)
Improve perfomance for ignored and improve perfomance for reduce plan. (by @alexander-akait in #289)
perf: speed up ignored matchers (~35–45% faster on POSIX paths) and reducePlan (~20–40% faster on medium and large plans). Also adds a tinybench suite under bench/ and a CodSpeed GitHub Actions workflow to catch future regressions. (by @alexander-akait in #287)
fix: don't log "Watchpack Error (initial scan)" for unreadable entries inside a watched parent directory, e.g. pagefile.sys on WSL or /efi on Linux (fixes #187). EACCES / ENODEV (and EINVAL on Windows) errors are now handled like EPERM / ENOENT / EBUSY: the entry is recorded as missing and the scan continues silently. (by @alexander-akait in #298)
fix: prevent unbounded watcher growth when a symlinked directory points back to one of its own ancestors (e.g. a/b/loop -> ..) with followSymlinks: true. Such symlinks are now recorded as plain entries instead of being descended into; symlinks pointing outside the watched tree (#231) behave as before. (by @alexander-akait in #297)
# Fixes - typo in typescript types
Features Added types
Node.js v24+ changed permission access error codes
ignore listening for the directory itself to be deleted
handle empty strings and arrays in ignored
do not report directory as initial missing on the second watch
respect filesystem accuracy more accurately
report time info for directories correctly
allow to grab separate file and directory time info objects
ignored optionNothing published for this version
fix warnings with ENOENT when symlinks are resolved by watchpack
use creation time instead of modified time for folder entries that are only watch for existence
fix incorrectly reported changes when attaching to an already watched directory
Old API is also accepted without warning (it may be deprecated in the next major)
ignored optionfollowSymlinks optionremove event when files or directories are not found during initial scan
missing items/RegExp/ for ignored optionWATCHPACK_RECURSIVE_WATCHER_LOGGING env var is setremovals and changes in the aggregated event no longer both contain a fileaggregateTimeout: 0 now works correctlyprocess.nextTick when unneeded on watcher creationadd logging of recursive watchers when WATCHPACK_RECURSIVE_WATCHER_LOGGING env var is set
WATCHPACK_RECURSIVE_WATCHER_LOGGING env var is setlimit maximum number of os watchers on OSX to 2000 and on windows to 10000
fix handling of renames that only change the casing of files on a case-insensitive filesystem
don't fire change events when files are only read
Support /RegExp/ for ignored option
/RegExp/ for ignored optionaggregateTimeout: 0 now works correctlyOld API is also accepted without warning (it may be deprecated in the next major)
remove event when files or directories are not found during initial scan
missing itemsremovals and changes in the aggregated event no longer both contain a fileincrease minimum node.js version to 10
process.nextTick when unneeded on watcher creationallow all Iterables instead of only Array
# Features * add followSymlinks option
followSymlinks optionNormalize readdir result to NFC
move dependency to devDependency
Polling no longer uses fs.watchFile but polls the directory directly
ignored optionfix a bug where scanning got stuck
Nothing published for this version
Nothing published for this version
Nothing published for this version
removed watchpack-chokidar2 notsup warning
remove unneeded files from package
force update to latest chokidar version for important bugfix
support chokidar 2 and 3 for node.js 6 - 14 support
Nothing published for this version
force upgrade chokidar for security reasons
Nothing published for this version
set polling interval for binary files too
Fixed watch for directories containing special glob characters
# Bugfixes: * readd mtimes property
# Bugfixes: * track removal times
don't adjust fs accuracy on inital scan
Fix watch callback being called twice during initial build.
watch callback being called twice during initial build.async dependency.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.