Skip to content

memfs v4

Compare
Choose a tag to compare
@streamich streamich released this 26 Jun 12:40
· 98 commits to master since this release

memfs v4 has been released, install 4.2.0 NPM package.

File System Access API

memfs added adapters for File System Access (FAS) API, which is a file system API available in browsers. FSA can write to a real user folder, which user picks; or without any permissions can write to a virtual file system, called OPFS (Origin Private File System). memfs implements adapters, which:

  • Construct a Node's fs-like API out of the FSA API.
    • In browser, support for synchronous fs methods is also available using a WebWorker.
  • Also, the other way around, memfs can provide FSA API on top of any fs-like file system.

Other notable changes

  • In-memory fs changes
    • A number of in-memory fs bugs were fixed.
    • Type interfaces of methods and options objects for in-memory fs were improved.
    • mkdirp and mkdripSync were removed, they were deprecated before. (You can pass the "recursive" flag to mkdir and mkdirSync, instead.)
    • Many re-usable Node.js fs utilities now live in the /src/node folder.
    • Promises API methods are now bound by default to their this object, just like in native fs module.
  • crudfs and casfs
    • crudfs implementation on top of Node fs was added.
    • crudfs implementation on top of File System Access API was added.
    • casfs implementation on top of crudfs was added.
  • print utility was added which allows to recursively print a directory tree to terminal.
  • snapshot utility was added which allows to create recursive binary snapshots of folders and then load them back into some folder.
  • The /demo folder now contains multiple Webpack demos.
  • Build changes and deprecations
    • TypeScript was upgraded from version 4 to 5.
    • tslib is now included as peer dependency, instead of TypeScript helpers being emitted into distributable.
    • TypeScript build target of the distributable is no es2017, instead of previously es5.
    • The library is now tested on Node v18+ versions.
    • BigInt shim is no longer shipped, memfs will rely on the BigInt provided by the JavaScript environment. You can shim that global, if necessary.
    • fs-monkey dependency was removed.
  • New features in this major release are marked as experimental, which means those APIs are in preview, their public interface may have breaking changes even across minor releases.
  • CircleCI was removed, now GitHub Actions power all builds and releases.
  • The next branch was tested, which deploys pre-releases.

Bug Fixes

* πŸ› add support for unknown nodes (77786f1)
* πŸ› allow readin into various kinds of buffers (361812d)
* πŸ› allow readin into various kinds of buffers (e9c70e9)
* πŸ› allow to seek in file (c04895b)
* πŸ› allow to seek in file (b363689)
* πŸ› correctly handle directory paths (ea909e8)
* πŸ› do not allow empty children names (f014fd8)
* πŸ› do not allow empty children names (43da1d6)
* πŸ› handle root folder better (89bbffd)
* πŸ› handle root folder better (76de780)
* πŸ› improve file opening and closing logic (403c271)
* πŸ› throw "ENOENT" and "ENOTDIR" when folder or file 404 (5de4faa)
* πŸ› throw "ENOENT" and "ENOTDIR" when folder or file 404 (ddd5d56)

Features

  • 🎸 add .toTree() to Volume (2d5c4cb)
  • 🎸 add .truncate() method (038ab36)
  • 🎸 add .truncate() method (085335c)
  • 🎸 add ability to close files (0db56be)
  • 🎸 add ability to close files (d3828a8)
  • 🎸 add ability to create sub directories (8f15bd9)
  • 🎸 add ability to create sub directories (528c807)
  • 🎸 add ability to remove all files (76cabc7)
  • 🎸 add ability to remove all files (566e29b)
  • 🎸 add appendFileSync() method (57192fe)
  • 🎸 add appendFileSync() method (27411e4)
  • 🎸 add basenem() utility (8b27695)
  • 🎸 add basenem() utility (43354e5)
  • 🎸 add binary serialization to snapshots (c1cd615)
  • 🎸 add copyFile() method (de2bb0a)
  • 🎸 add copyFile() method (5e207c4)
  • 🎸 add copyFileSync() method (7e0137c)
  • 🎸 add copyFileSync() method (5fc1bac)
  • 🎸 add createSwapFile() method (dfdb908)
  • 🎸 add createSwapFile() method (b07ce79)
  • 🎸 add crudfs types (18c0658)
  • 🎸 add existsSync() method (0492a98)
  • 🎸 add existsSync() method (073ec6b)
  • 🎸 add fstatSync() method (f13ddb7)
  • 🎸 add fstatSync() method (6b1597a)
  • 🎸 add initial writing implementation (2f9542c)
  • 🎸 add initial writing implementation (6a50382)
  • 🎸 add integrity check on read (710eb2f)
  • 🎸 add json encoding for snapshots (41f9b8c)
  • 🎸 add lstat() and fstat() methods (ce5dd5e)
  • 🎸 add lstat() and fstat() methods (e147d58)
  • 🎸 add missing callback API methods and some sync API ones (956533a)
  • 🎸 add missing promises API types (f6727f3)
  • 🎸 add missing synchronous method types (ac38b5d)
  • 🎸 add mkdirSync() method (57f386b)
  • 🎸 add mkdirSync() method (bcad970)
  • 🎸 add mkdtempSync() method (1ac2df4)
  • 🎸 add mkdtempSync() method (68033dd)
  • 🎸 add options to promises.rmdir() method (ce268bb)
  • 🎸 add options to promises.rmdir() method (0628d56)
  • 🎸 add pathToLocation() utility (8e0136a)
  • 🎸 add pathToLocation() utility (cb92a99)
  • 🎸 add read/write mode separation (b4b6fcb)
  • 🎸 add read/write mode separation (60a65c1)
  • 🎸 add readdirSync() method (2178a50)
  • 🎸 add readdirSync() method (3689abd)
  • 🎸 add readlinkSync() method (f398908)
  • 🎸 add readlinkSync() method (8d243a0)
  • 🎸 add readSync() method (31383a8)
  • 🎸 add readSync() method (3729cd0)
  • 🎸 add realpathSync() method (f9a3cbe)
  • 🎸 add realpathSync() method (75890e0)
  • 🎸 add renameSync() method (a1674e4)
  • 🎸 add renameSync() method (5b1cd63)
  • 🎸 add rm() method (239437d)
  • 🎸 add rm() method (29a7dc8)
  • 🎸 add rmdirSync() method (59ccf3c)
  • 🎸 add rmdirSync() method (695b62a)
  • 🎸 add rmSync() method (a39e9a2)
  • 🎸 add rmSync() method (aa9acb3)
  • 🎸 add snapshot creation utilities (9fc8f13)
  • 🎸 add some common objects (b68ea2a)
  • 🎸 add some common objects (c89744d)
  • 🎸 add sumlink printing support (1850dae)
  • 🎸 add sync api (29c035a)
  • 🎸 add sync api (16d6600)
  • 🎸 add timeout to spin lock (1e2fc72)
  • 🎸 add timeout to spin lock (48e8e74)
  • 🎸 add truncateSync() and ftruncateSync() methods (4caf28b)
  • 🎸 add truncateSync() and ftruncateSync() methods (2b77619)
  • 🎸 add typed array view support to volume (a8bee73)
  • 🎸 add typed array view support to volume (7c8439f)
  • 🎸 add unlinkSync() method (4b3444d)
  • 🎸 add unlinkSync() method (417f911)
  • 🎸 add writev() method (17b0446)
  • 🎸 add writev() method (8190bfd)
  • 🎸 create FSA types folder (c153506)
  • 🎸 create FSA types folder (bb0c75a)
  • 🎸 create Node fs api tyeps (27fd08a)
  • 🎸 create Node fs api tyeps (4db1321)
  • 🎸 expose FSA from index file (6865a05)
  • 🎸 expose FSA from index file (77696f5)
  • 🎸 implement .del() method (9a7fd37)
  • 🎸 implement .drop() method (1b893a2)
  • 🎸 implement .get() method (63aacb6)
  • 🎸 implement .getDirectoryHandle() method (b6b026a)
  • 🎸 implement .getDirectoryHandle() method (090980c)
  • 🎸 implement .getFile() method (b8601cc)
  • 🎸 implement .getFile() method (17015a3)
  • 🎸 implement .getFileHandle() method (71567c9)
  • 🎸 implement .getFileHandle() method (40bdc13)
  • 🎸 implement .isSameEntry() method (f18d91e)
  • 🎸 implement .isSameEntry() method (438806b)
  • 🎸 implement .list() method (4a064cf)
  • 🎸 implement .mkdir method (2623049)
  • 🎸 implement .mkdir method (be1525a)
  • 🎸 implement .mkdtemp() method (cd54e9b)
  • 🎸 implement .mkdtemp() method (2db4cd0)
  • 🎸 implement .removeEntry() method (48617aa)
  • 🎸 implement .removeEntry() method (dca57a2)
  • 🎸 implement .resolve() method (bf47b96)
  • 🎸 implement .resolve() method (9d5669c)
  • 🎸 implement .values() and .entries() (f13de3b)
  • 🎸 implement .values() and .entries() (177010a)
  • 🎸 implement .write() for FSA (8226541)
  • 🎸 implement .write() for FSA (6a2fa2d)
  • 🎸 implement access() method (0a43a1b)
  • 🎸 implement access() method (c72390b)
  • 🎸 implement accessSync() method (accebdb)
  • 🎸 implement accessSync() method (719a19f)
  • 🎸 implement async verions of snapshotting (18912bf)
  • 🎸 implement basic readdir (898e221)
  • 🎸 implement basic readdir (685bc7e)
  • 🎸 implement basic rename() method, only for files (169662a)
  • 🎸 implement basic rename() method, only for files (4769314)
  • 🎸 implement basic state() method (425cad7)
  • 🎸 implement basic state() method (4039d64)
  • 🎸 implement CAS storage (33ddbcc)
  • 🎸 implement closeSync() method (24841fa)
  • 🎸 implement closeSync() method (646efaf)
  • 🎸 implement crudfs .put() method (505dc20)
  • 🎸 implement crudfs on top of fs (cb7ac4d)
  • 🎸 implement Dirent listings (03e60d0)
  • 🎸 implement Dirent listings (5d6f976)
  • 🎸 implement exists() method (615e88f)
  • 🎸 implement exists() method (0753937)
  • 🎸 implement first version of readFile() method (e046128)
  • 🎸 implement first version of readFile() method (629f22a)
  • 🎸 implement first version of worker (3662003)
  • 🎸 implement first version of worker (caf8394)
  • 🎸 implement FSA ReadStream (bc50fc5)
  • 🎸 implement FSA ReadStream (53784d9)
  • 🎸 implement info() method (eea9215)
  • 🎸 implement initial version of .open() method (b3983df)
  • 🎸 implement initial version of .open() method (cb363b5)
  • 🎸 implement initial version of appendFile() method (616be8d)
  • 🎸 implement initial version of appendFile() method (65580aa)
  • 🎸 implement initial version of writeFile() method (80e8499)
  • 🎸 implement initial version of writeFile() method (e2b2bfd)
  • 🎸 implement keys() method (33f9af0)
  • 🎸 implement keys() method (b8e8a4c)
  • 🎸 implement openSync() method (8ecac69)
  • 🎸 implement openSync() method (4b7eddd)
  • 🎸 implement read() method (33bea4b)
  • 🎸 implement read() method (7357c14)
  • 🎸 implement readFileSync() method (3a1b737)
  • 🎸 implement readFileSync() method (2a07e34)
  • 🎸 implement readFileSync() method (953d276)
  • 🎸 implement readFileSync() method (bb803e2)
  • 🎸 implement realpath() method (458a7b2)
  • 🎸 implement realpath() method (99b12dc)
  • 🎸 implement rmdir() method (c06734b)
  • 🎸 implement rmdir() method (973af0a)
  • 🎸 implement sync messenger (1c0bd59)
  • 🎸 implement sync messenger (d221870)
  • 🎸 implement sync write method (3017ecd)
  • 🎸 implement sync write method (22047da)
  • 🎸 implement toTreeSync() method (09c9770)
  • 🎸 implement truncation (af8452e)
  • 🎸 implement truncation (d4469d1)
  • 🎸 implement unlink() method (e11a383)
  • 🎸 implement unlink() method (6bd3e75)
  • 🎸 implement writeSync() method (7a2fced)
  • 🎸 implement writeSync() method (12a8b3f)
  • 🎸 improve mkdir method (e6dd59e)
  • 🎸 improve mkdir method (c393f6c)
  • 🎸 improve read stream interfaces (7e1a844)
  • 🎸 improve read stream interfaces (6d5de0c)
  • 🎸 improve stat method (505a1d9)
  • 🎸 improve stat method (c6eeab4)
  • 🎸 improve write stream, better flag handling (531f2a7)
  • 🎸 improve write stream, better flag handling (7b9e0a3)
  • 🎸 improve writing at offset logic (71b6afc)
  • 🎸 improve writing at offset logic (392932a)
  • 🎸 improve writing to file (1de0e06)
  • 🎸 improve writing to file (3edcac1)
  • 🎸 include "writeSync" method for sync writer (b267f78)
  • 🎸 include "writeSync" method for sync writer (b006b2d)
  • 🎸 introduce FSA context (f603262)
  • 🎸 introduce FSA context (b696e09)
  • 🎸 make basic WriteStream work (69281ff)
  • 🎸 make basic WriteStream work (c109af1)
  • 🎸 make promises methods bound (3010141)
  • 🎸 make statSync() resolve the path correctly (0d81728)
  • 🎸 make statSync() resolve the path correctly (7801533)
  • 🎸 normalize adapter rpc (16ce2cf)
  • 🎸 normalize adapter rpc (96b8374)
  • 🎸 progress on writable stream (a568afd)
  • 🎸 progress on writable stream (9900423)
  • 🎸 setup fsa to node utility (50d2a1e)
  • 🎸 setup fsa to node utility (5fa0d61)
  • 🎸 setup node-to-fsa folder (a4268c6)
  • 🎸 setup node-to-fsa folder (16e78e3)
  • 🎸 setup NodeCrud implementation (39073ce)
  • 🎸 setup webfs (68f0014)
  • 🎸 setup webfs (99c915f)
  • 🎸 standardize message contents (b3254f6)
  • 🎸 standardize message contents (c254dc7)
  • 🎸 start synchronous file handle implementation (f9b0f73)
  • 🎸 start synchronous file handle implementation (d05c407)
  • 🎸 start WriteStream implementation (5971c39)
  • 🎸 start WriteStream implementation (32e13a8)
  • 🎸 throw exception on closed files (7adff27)
  • 🎸 throw exception on closed files (5119b8f)
  • 🎸 track number of written bytes (b80f7b7)
  • 🎸 track number of written bytes (7a65daa)
  • 🎸 write through a swap file (84cecec)
  • 🎸 write through a swap file (5134766)

Full Changelog: v3.6.0...v4.2.0