# @jsonjoy.com/fs-core

> Core filesystem primitives: Node, Link, File, Superblock

Latest version **4.79.0** (published 2026-09-22) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @jsonjoy.com/fs-core
pnpm add @jsonjoy.com/fs-core
yarn add @jsonjoy.com/fs-core
bun add @jsonjoy.com/fs-core
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 4.79.0 |
| Published | 2026-09-22 |
| First published | 2026-01-19 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.0 |
| Dependencies | 3 |
| Unpacked size | 240.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 2091 |
| Author | streamich |
| Maintainers | json-joy-team, streamich |
| Keywords | node, fs, filesystem, inode, link, file, superblock, virtual, memory |

## Links

- npm: https://www.npmjs.com/package/@jsonjoy.com/fs-core
- Repository: https://github.com/streamich/memfs
- Homepage: https://github.com/streamich/memfs/tree/master/packages/fs-core
- Issues: https://github.com/streamich/memfs/issues
- Funding: https://github.com/sponsors/streamich
- npm.io page: https://npm.io/package/@jsonjoy.com/fs-core

## Dependencies (3)

- [thingies](https://npm.io/package/thingies.md) ^2.5.0
- [@jsonjoy.com/fs-node-utils](https://npm.io/package/@jsonjoy.com/fs-node-utils.md) 4.79.0
- [@jsonjoy.com/fs-node-builtins](https://npm.io/package/@jsonjoy.com/fs-node-builtins.md) 4.79.0

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 4.79.0 (latest) — 2026-09-22
- 4.78.1 — 2026-09-17
- 4.78.0 — 2026-09-13
- 4.77.0 — 2026-09-13
- 4.76.0 — 2026-09-12
- 4.75.0 — 2026-09-11
- 4.74.0 — 2026-09-10
- 4.73.0 — 2026-09-10
- 4.72.2 — 2026-09-10
- 4.72.1 — 2026-09-09
- 4.72.0 — 2026-09-09
- 4.71.1 — 2026-09-09
- 4.71.0 — 2026-09-04
- 4.70.0 — 2026-09-04
- 4.69.1 — 2026-09-02
- … 33 more at https://npm.io/package/@jsonjoy.com/fs-core/versions

## README

# memfs

[![][npm-badge]][npm-url]

[npm-url]: https://www.npmjs.com/package/memfs
[npm-badge]: https://img.shields.io/npm/v/memfs.svg

JavaScript file system utilities for Node.js and browser. Implementation of in-memory [Node.js `fs` module API](https://nodejs.org/api/fs.html) and in-memory [browser File System API](https://developer.mozilla.org/en-US/docs/Web/API/File_System_API), as well as adapters from `fs` module to File Sytem API and from File Sytem API to `fs` module.

## Install

```shell
npm i memfs
```

## Resources

- [In-memory Node.js `fs` API](./docs/node/index.md)
- [In-memory browser File System (Access) API](./docs/fsa/fsa.md)
- [`fs` to File System (Access) API adapter](./docs/fsa/fs-to-fsa.md)
- [File System (Access) API to `fs` adapter](./docs/fsa/fsa-to-fs.md)
- [Directory `snapshot` utility](./docs/snapshot/index.md)
- [`print` directory tree to terminal](./docs/print/index.md)
- [Code reference](https://streamich.github.io/memfs/)
- [Test coverage](https://streamich.github.io/memfs/coverage/lcov-report/)

## Watching

All file-watching APIs are implemented on both sides of the `fs` and File System API divide:

| Feature                                                                    | Package                                                  | Notes                                                                                   |
| -------------------------------------------------------------------------- | -------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `fs.watch` — `recursive`, `encoding`, `signal`, `throwIfNoEntry`, `ignore` | [`@jsonjoy.com/fs-node`](packages/fs-node)               | `'error'`/`'close'` events, `ref()`/`unref()`                                           |
| `fs.watchFile` / `fs.unwatchFile`                                          | [`@jsonjoy.com/fs-node`](packages/fs-node)               | polling, `bigint`, Node's reappearance semantics                                        |
| `fs.promises.watch` async iterator                                         | [`@jsonjoy.com/fs-node`](packages/fs-node)               | `maxQueue`, `overflow`, `AbortError` on abort                                           |
| [`FileSystemObserver`][observer]                                           | [`@jsonjoy.com/fs-fsa`](packages/fs-fsa)                 | deterministic OPFS profile: precise records, real `"moved"` records, microtask batching |
| `fs.watch`/`fs.watchFile` over a real FSA directory                        | [`@jsonjoy.com/fs-fsa-to-node`](packages/fs-fsa-to-node) | works over OPFS in Chrome 133+ via the native observer                                  |
| `FileSystemObserver` over any `fs`                                         | [`@jsonjoy.com/fs-node-to-fsa`](packages/fs-node-to-fsa) | best-effort profile: renames stat-classified, no `"moved"` records                      |

Intentional divergences from real watchers (the in-memory backend is deterministic, so platform
unreliability is not emulated):

- Paths are watched semantically rather than by inode: after delete-and-recreate, memfs reports
  events for the recreated entry, while a real POSIX watcher keeps watching the dead inode.
- Exactly one event per logical operation — no platform duplicate events.
- `filename` is never `null`.
- The Node-style `FSWatcher` delivers events synchronously inside the mutating operation, whereas
  real Node defers to the event loop; the `FileSystemObserver` batches per microtask, as the spec
  requires.

[observer]: https://developer.mozilla.org/en-US/docs/Web/API/FileSystemObserver

## Demos

- [Git in browser, which writes to a real folder](demo/git-fsa/README.md)
- [Git in browser, which writes to OPFS file system](demo/git-opfs/README.md)
- [Git on in-memory file system](demo/git/README.md)
- [`fs` in browser, creates a `.tar` file in real folder](demo/fsa-to-node-zipfile/README.md)
- [`fs` in browser, synchronous API, writes to real folder](demo/fsa-to-node-sync-tests/README.md)

## See also

- [`unionfs`][unionfs] - creates a union of multiple filesystem volumes
- [`fs-monkey`][fs-monkey] - monkey-patches Node's `fs` module and `require` function
- [`linkfs`][linkfs] - redirects filesystem paths
- [`spyfs`][spyfs] - spies on filesystem actions

[unionfs]: https://github.com/streamich/unionfs
[fs-monkey]: https://github.com/streamich/fs-monkey
[linkfs]: https://github.com/streamich/linkfs
[spyfs]: https://github.com/streamich/spyfs

## License

Apache 2.0

---
_Source: https://npm.io/package/@jsonjoy.com/fs-core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
