debounceoption added towatch
- A file poller was added to pick up file changes that may have been missed by file system events. This adds a small CPU overhead but means changed files will all eventually be detected.
- BREAKING
- A short debounce time was added to the
onChangecallback to prevent duplicate changes triggering in rapid succession. - The
onChangecallback now receivespathsinstead of a singlepath. - The
WATCHY_PATHenvvar has been renamed toWATCHY_PATHSand contains a comma-separated list of all paths changed
- A short debounce time was added to the
- Add TS definition file
- BREAKING
- Default export converted to named
watchexport. chokidardependency dropped. Usesfs.watchnow.usePollingoption droppedonErrorcallback removed.watchwill fail synchronously if a watcher is not able to created on the base directory.- onChange callback changed from
(options: { action: string; path: string }) => voidto just(path: string) => void. Action was often incorrect/inconsistent. - The CLI remains the same except for the removal of
--use-polling
- Default export converted to named
- Upgrade to ES modules.
- Drop -n/--no-color flag, determine color based on TTY. Use FORCE_COLOR=0/1 envvar override color support.
- @atom/watcher is likely being discontinued, so switching to chokidar@3
- Fix typo in usage output.
- Fix package.json
mainentry.
- File watching is now handled by the
@atom/watcherpackage. - BREAKING
Removed
i/--ignoreoption. - BREAKING
-w/--watcharguments are now specified as extglob patterns.
-
Add
-K/--kill-signaloption to overrideSIGTERMwith a custom signal. -
Add
-m/--multipleflag to allow the kill signal to be sent to the process multiple times. -
-Kand-mmake upgrading a process on change possible, for examplewatchy -w /etc/nginx/nginx.conf -mK SIGHUP -- nginx
will upgrade nginx whenever the config file is changed.
-
BREAKING The path passed to
-w/--watchis no longer split on comma. This was a bit of a lazy way to handle multiple paths and inherently prevented the possibility of watching a path with a comma. From0.7.0on, specify multiple paths to watch by passing multiple-w/--watchflags.For example, instead of
watchy -w bin,lib,CHANGELOG.md -- ls
use
watchy -w bin -w lib -w CHANGELOG.md -- ls
- Add a changelog.
- Add
--no-init-spawnoption to optionally not run the command on start, but only after changes.