Skip to content

2.9.0

Latest

Choose a tag to compare

@james-pre james-pre released this 04 Nov 05:52
Immutable release. Only release title and notes can be modified.
v2.9.0
2cbc7af

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 StoreFS to use binary directory listings, instead of JSON (#235)
  • SingleBufferStore now 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, and promises.mkstemp (Node #66484)
  • Added openAsBlobSync (Node #65644)
  • Added FileHandle.pullSync
  • Added support for maxDepth to glob and globSync (Node #64003)
  • Added support for the fd and flags options to createReadStream and createWriteStream (Node #66131)
  • Added support for the buffer option to readFile, promises.readFile, and FileHandle.readFile (Node #63634)
  • Added missing UV_FS_O_* (ignored)
  • Added missing fs.realpath.native and fs.realpathSync.native
  • Added support for autoClose to FileHandle.readableWebStream (Node #58548)
  • Added support for signal to stat and lstat (Node #57775, #63142, #63143)
  • Added support for ignore to watch and promises.watch (Node #61433)
  • Fixed promises.watch dropping events that arrive before they are consumed (Node #58490)
  • Added support for maxQueue and overflow to promises.watch
  • Added support for recursive and encoding to opendir and opendirSync (Node #41439, #55744)
  • Added support for brace expansion, character classes, and extended globs to glob, globSync, and path.matchesGlob (Node #65392)
  • Added StatWatcher.ref and StatWatcher.unref
  • Added support for the bigint option to watchFile
  • Added support for the signal option to watch (Node #37190)
  • Added support for the signal option to readFile and writeFile (Node #35911, #35993, #37402, #37393, #41008)
  • Added support for iterables and async iterables to writeFile and appendFile (Node #37490, #38615, #39836)
  • Added fd to ReadStream and WriteStream (Node #3679)

Fixes

  • Fixed readSync and FileHandle.ready not handling fractional lengths correctly (Node #65521)
  • Fixed symlink not accept null for the type (Node #49741)
  • Fixed normalizePath incorrectly coercing numbers (Node #57567)
  • Fixed write functions coercing invalid data instead of throwing (Node #42796)
  • Fixed Dir.read not handling errors correctly
  • Fixed mutating options after calling fs.promises.readdir affecting the results (Node #56057)
  • Removed Dirent.path (Node #55548)
  • Fixed cp and cpSync throwing for errorOnExist when force is not false
  • Fixed writeSync and write not supporting an options object (Node #42601)
  • Fixed read never 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 cp and cpSync not applying filter to the source and cp not awaiting it (Node #45143, #44922)
  • Fixed directories created by cp and cpSync not having the source directory's mode (Node #65488)
  • Fixed cp and cpSync failing when a symlink already exists at the destination (Node #58476)
  • Fixed cp and cpSync overwriting existing files when force is false (Node #66305)
  • Fixed cp and cpSync with dereference failing on symlinks to directories (Node #54732)
  • Added support for mode to cp and cpSync (Node #47084)
  • Fixed cp and cpSync writing through existing destination files instead of replacing them
  • Fixed cp and cpSync not throwing ERR_FS_CP_DIR_TO_NON_DIR and ERR_FS_CP_NON_DIR_TO_DIR (Node #53150)
  • Fixed positional reads and writes moving the file position
  • Fixed readv, writev, readvSync, and writevSync position handling
  • Fixed symlink writing through existing broken symlinks
  • Fixed symlink reporting errors for the wrong path and syscall
  • Fixed readlinkSync being typed as returning a Buffer without option
  • Fixed readlink ignoring options
  • Fixed rmdir not calling the callback when passed options
  • Fixed readFile, writeFile, and appendFile closing caller-provided file descriptors and handles
  • Fixed readFile and writeFile on file descriptors and handles not using the current position
  • Fixed the callback readFile, writeFile, and appendFile not accepting file descriptors
  • Fixed reads using the end of the file as the position for files opened in append mode
  • Fixed Stats date properties not being enumerable (Node #63328)
  • Fixed glob and globSync throwing on unreadable directories (Node #58674)
  • Fixed glob and globSync not descending into directories matched by wildcards
  • Fixed file streams never closing their handle and ignoring autoClose
  • Fixed WriteStream.close destroying the stream instead of ending it
  • FileHandle.close is now idempotent
  • Improved glob matching performance (again)
  • Fixed path.matchesGlob having the wrong argument order
  • Fixed matchesGlob tests
  • Fixed file streams and readableWebStream reading from the start of the file instead of the current position
  • Fixed native setup not wrapping .native
  • mkdtemp now returns a Buffer when the prefix is a Buffer (Node #64397)
  • Fixed mkdtemp ignoring encodings other than buffer
  • watchFile now returns a StatWatcher
  • Fixed FileHandle.pull reading from the start of the file instead of the current position
  • Fixed openAsBlob not validating options
  • Reorganized node utils and validation (into the first galactic empire!)
  • Fixed open, openSync, and promises.open not defaulting flags to 'r' (Node #23767)
  • Added the open(path, callback) overload
  • Fixed mkdtemp and mkstemp throwing on an empty prefix (Node #39028)
  • Fixed truncate, ftruncate, and FileHandle.truncate throwing on negative lengths instead of truncating to 0 (Node #37483)
  • Fixed watch and promises.watch not throwing when the path does not exist (Node #2748)
  • Fixed Dir.close calling its callback synchronously (Node #36243)
  • Fixed StatWatcher not emitting stop when unwatched (Node #8524)
  • Fixed rm and rmSync removing directories without recursive instead of throwing ERR_FS_EISDIR (Node #38684, #35563)
  • Fixed cp and cpSync throwing errors with the wrong codes (Node #41106)
  • Fixed cp and cpSync deleting the file when copying it onto itself
  • Fixed cp and cpSync recursing infinitely when copying a directory into itself
  • Fixed file write streams and writableWebStream writing from the start of the file instead of the current position
  • Fixed file streams not emitting open and ready (Node #19408, #31790, #29930)
  • Fixed BigIntStats fields being numbers instead of bigints (Node #20220)
  • Added util.promisify support to read, write, readv, writev, and exists (Node #12442, #33590, #13316)
  • Fixed FileHandle.read without a buffer allocating the size of the file instead of 16 KiB (Node #38287, #31402)
  • Added the missing read overloads with optional parameters
  • Fixed FSWatcher.close emitting close synchronously and on every call

Misc. changes

  • Raised buffer size for tests
  • Fixed prereleases not working with npm publish
  • Renamed Writer.desiredSize to canWrite for Node.js types 26.6
  • Fixed glob matching compatibility (**/x, ?, a**b, etc.)
  • Improved glob matching performance