Repository navigation
This is quite possibly the biggest release I've ever made in terms of the number of changes/commits. There is some exciting news though!
StoreFS and SingleBuffer
- Added support for atomic stores to
StoreFS - Changed
StoreFSto use binary directory listings, instead of JSON (#235) SingleBufferStorenow supports atomic transactions (#329)- Added atomic
SingleBufferTransaction(#329) - Fixed
Async()not committing the sync transaction when copying
Node.js compatibility
With corresponding changes to @zenfs/devel, this release marks the introduction of tracking all Node.js fs: PRs and documented features. With that, a metric ton of changes are included that bring ZenFS up to a glorious 100% API compatibility with Node.js 27.0.0! Every function, option, and class is supported. All 637 fs: PRs since Node.js 4.0 are tracked and resolved. All 300 documented features are supported and present.
Features
- Added
mkstemp,mkstempSync, andpromises.mkstemp(Node #66484) - Added
openAsBlobSync(Node #65644) - Added
FileHandle.pullSync - Added support for
maxDepthtoglobandglobSync(Node #64003) - Added support for the
fdandflagsoptions tocreateReadStreamandcreateWriteStream(Node #66131) - Added support for the
bufferoption toreadFile,promises.readFile, andFileHandle.readFile(Node #63634) - Added missing
UV_FS_O_*(ignored) - Added missing
fs.realpath.nativeandfs.realpathSync.native - Added support for
autoClosetoFileHandle.readableWebStream(Node #58548) - Added support for
signaltostatandlstat(Node #57775, #63142, #63143) - Added support for
ignoretowatchandpromises.watch(Node #61433) - Fixed
promises.watchdropping events that arrive before they are consumed (Node #58490) - Added support for
maxQueueandoverflowtopromises.watch - Added support for
recursiveandencodingtoopendirandopendirSync(Node #41439, #55744) - Added support for brace expansion, character classes, and extended globs to
glob,globSync, andpath.matchesGlob(Node #65392) - Added
StatWatcher.refandStatWatcher.unref - Added support for the
bigintoption towatchFile - Added support for the
signaloption towatch(Node #37190) - Added support for the
signaloption toreadFileandwriteFile(Node #35911, #35993, #37402, #37393, #41008) - Added support for iterables and async iterables to
writeFileandappendFile(Node #37490, #38615, #39836) - Added
fdtoReadStreamandWriteStream(Node #3679)
Fixes
- Fixed
readSyncandFileHandle.readynot handling fractional lengths correctly (Node #65521) - Fixed symlink not accept
nullfor thetype(Node #49741) - Fixed
normalizePathincorrectly coercing numbers (Node #57567) - Fixed write functions coercing invalid data instead of throwing (Node #42796)
- Fixed
Dir.readnot handling errors correctly - Fixed mutating
optionsafter callingfs.promises.readdiraffecting the results (Node #56057) - Removed
Dirent.path(Node #55548) - Fixed
cpandcpSyncthrowing forerrorOnExistwhenforceis notfalse - Fixed
writeSyncandwritenot supporting an options object (Node #42601) - Fixed
readnever calling the callback when passed an options object (Node #42768) - Fixed callbacks being called a second time with their own error when they throw
- Fixed glob wildcards matching dot files
- Fixed non-recursive watchers receiving events for nested files
- Fixed concurrent
FileHandle.writer()writes overwriting each other (Node #66483) - Fixed
cpandcpSyncnot applyingfilterto the source andcpnot awaiting it (Node #45143, #44922) - Fixed directories created by
cpandcpSyncnot having the source directory's mode (Node #65488) - Fixed
cpandcpSyncfailing when a symlink already exists at the destination (Node #58476) - Fixed
cpandcpSyncoverwriting existing files whenforceisfalse(Node #66305) - Fixed
cpandcpSyncwithdereferencefailing on symlinks to directories (Node #54732) - Added support for
modetocpandcpSync(Node #47084) - Fixed
cpandcpSyncwriting through existing destination files instead of replacing them - Fixed
cpandcpSyncnot throwingERR_FS_CP_DIR_TO_NON_DIRandERR_FS_CP_NON_DIR_TO_DIR(Node #53150) - Fixed positional reads and writes moving the file position
- Fixed
readv,writev,readvSync, andwritevSyncposition handling - Fixed
symlinkwriting through existing broken symlinks - Fixed
symlinkreporting errors for the wrong path and syscall - Fixed
readlinkSyncbeing typed as returning aBufferwithout option - Fixed
readlinkignoringoptions - Fixed
rmdirnot calling the callback when passed options - Fixed
readFile,writeFile, andappendFileclosing caller-provided file descriptors and handles - Fixed
readFileandwriteFileon file descriptors and handles not using the current position - Fixed the callback
readFile,writeFile, andappendFilenot accepting file descriptors - Fixed reads using the end of the file as the position for files opened in append mode
- Fixed
Statsdate properties not being enumerable (Node #63328) - Fixed
globandglobSyncthrowing on unreadable directories (Node #58674) - Fixed
globandglobSyncnot descending into directories matched by wildcards - Fixed file streams never closing their handle and ignoring
autoClose - Fixed
WriteStream.closedestroying the stream instead of ending it FileHandle.closeis now idempotent- Improved glob matching performance (again)
- Fixed
path.matchesGlobhaving the wrong argument order - Fixed
matchesGlobtests - Fixed file streams and
readableWebStreamreading from the start of the file instead of the current position - Fixed native setup not wrapping
.native mkdtempnow returns aBufferwhen the prefix is aBuffer(Node #64397)- Fixed
mkdtempignoring encodings other thanbuffer watchFilenow returns aStatWatcher- Fixed
FileHandle.pullreading from the start of the file instead of the current position - Fixed
openAsBlobnot validatingoptions - Reorganized node utils and validation (into the first galactic empire!)
- Fixed
open,openSync, andpromises.opennot defaultingflagsto'r'(Node #23767) - Added the
open(path, callback)overload - Fixed
mkdtempandmkstempthrowing on an empty prefix (Node #39028) - Fixed
truncate,ftruncate, andFileHandle.truncatethrowing on negative lengths instead of truncating to 0 (Node #37483) - Fixed
watchandpromises.watchnot throwing when the path does not exist (Node #2748) - Fixed
Dir.closecalling its callback synchronously (Node #36243) - Fixed
StatWatchernot emittingstopwhen unwatched (Node #8524) - Fixed
rmandrmSyncremoving directories withoutrecursiveinstead of throwingERR_FS_EISDIR(Node #38684, #35563) - Fixed
cpandcpSyncthrowing errors with the wrong codes (Node #41106) - Fixed
cpandcpSyncdeleting the file when copying it onto itself - Fixed
cpandcpSyncrecursing infinitely when copying a directory into itself - Fixed file write streams and
writableWebStreamwriting from the start of the file instead of the current position - Fixed file streams not emitting
openandready(Node #19408, #31790, #29930) - Fixed
BigIntStatsfields being numbers instead of bigints (Node #20220) - Added
util.promisifysupport toread,write,readv,writev, andexists(Node #12442, #33590, #13316) - Fixed
FileHandle.readwithout a buffer allocating the size of the file instead of 16 KiB (Node #38287, #31402) - Added the missing
readoverloads with optional parameters - Fixed
FSWatcher.closeemittingclosesynchronously and on every call
Misc. changes
- Raised buffer size for tests
- Fixed prereleases not working with npm publish
- Renamed
Writer.desiredSizetocanWritefor Node.js types 26.6 - Fixed glob matching compatibility (
**/x,?,a**b, etc.) - Improved glob matching performance