You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
node:fs in v0.10.5 covers sync, callback and promise APIs (readFile, createReadStream, realpath, symlink, chmod, mkdtemp, opendir, lstat, …) but fs.watch, fs.watchFile, fs.unwatchFile and fs.promises.watch are absent (crates/slice-engine/src/preludes/node_builtins.rs, verified at a0c723e).
Why it matters
File watching is the entry point for dev servers, hot-reload loops, log tailers and config reloaders. Many npm packages (chokidar, nodemon, vite, tsx --watch, pino rotation plugins) call fs.watch directly and currently throw TypeError: fs.watch is not a function.
Proposal
Implement fs.watch(path, [options], listener) returning an FSWatcher (EventEmitter with change/rename/error/close, .close(), .ref()/.unref()).
Implement fs.promises.watch() as an async iterator.
Back it with the notify crate already used by slice run --watch, and route events through runtime/event_loop.rs.
Gate watched paths with the existing FsCap read allow-list; a watcher on a non-permitted path should fail with the same FsReadDenied error as readFile.
VFS semantics: watchers should fire for in-memory VFS writes as well as host-disk writes, otherwise slice test time-travel rollbacks produce silent inconsistencies.
Also missing in node:fs
fs.cp, fs.readlink, fs.truncate, fs.utimes (+ sync/promises variants). These are smaller and could ship in the same change.
statSync (�igint/ hrowIfNoEntry), lstatSync,
ealpathSync, chmodSync, chownSync, �ccessSync, opendirSync, and createReadStream/createWriteStream were already implemented in Slice's copy-on-write VFS.
Added the remaining functions (cpSync/cp,
eadlinkSync/
eadlink, runcateSync/ runcate, utimesSync/utimes, lutimesSync/lutimes, watch/watchFile/unwatchFile, and s.promises.* equivalents) backed by the in-memory CoW VFS with zero cold-start overhead.
Activity
siktec-lab commentedon Nov 9, 2026
Addressed in #41 (�0.10.6).
ealpathSync, chmodSync, chownSync, �ccessSync, opendirSync, and createReadStream/createWriteStream were already implemented in Slice's copy-on-write VFS.
eadlinkSync/
eadlink, runcateSync/ runcate, utimesSync/utimes, lutimesSync/lutimes, watch/watchFile/unwatchFile, and s.promises.* equivalents) backed by the in-memory CoW VFS with zero cold-start overhead.