# @jsonjoy.com/fs-node-to-fsa

> Adapter to convert Node.js fs API to File System Access API

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

## Install

```sh
npm install @jsonjoy.com/fs-node-to-fsa
pnpm add @jsonjoy.com/fs-node-to-fsa
yarn add @jsonjoy.com/fs-node-to-fsa
bun add @jsonjoy.com/fs-node-to-fsa
```

## 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 | 116.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 2095 |
| Author | streamich |
| Maintainers | json-joy-team, streamich |
| Keywords | fs, filesystem, fsa, file-system-access, node-to-fsa, adapter |

## Links

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

## Dependencies (3)

- [@jsonjoy.com/fs-fsa](https://npm.io/package/@jsonjoy.com/fs-fsa.md) 4.79.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
- … 32 more at https://npm.io/package/@jsonjoy.com/fs-node-to-fsa/versions

## README

# @jsonjoy.com/fs-node-to-fsa

Adapter to convert [Node.js fs API][node-fs] to [File System Access API][fsa] (FSA).

## Installation

```bash
npm install @jsonjoy.com/fs-node-to-fsa
```

## Usage

```ts
import { nodeToFsa } from '@jsonjoy.com/fs-node-to-fsa';
import * as fs from 'fs';

const dir = nodeToFsa(fs, '/path/to/directory', { mode: 'readwrite' });

// Now use the FSA API
for await (const [name, handle] of dir.entries()) {
  console.log(name, handle.kind);
}
```

## FileSystemObserver

`NodeFileSystemObserver` implements the [`FileSystemObserver` proposal][observer]
on top of the Node.js `fs.watch` API. It is a best-effort implementation, per
the proposal's allowance for local file systems: `rename` events are classified
into `"appeared"`/`"disappeared"` records by stat-ing the path, and no
`"moved"` records are ever produced.

```ts
import { nodeToFsa, NodeFileSystemObserver } from '@jsonjoy.com/fs-node-to-fsa';
import * as fs from 'fs';

const dir = nodeToFsa(fs, '/path/to/directory', { mode: 'readwrite' });
const observer = new NodeFileSystemObserver(fs, records => console.log(records));
await observer.observe(dir, { recursive: true });
```

## Reference

- [`nodeToFsa(fs, path, ctx)`](src/index.ts) - Converts a Node.js `fs` module to a `FileSystemDirectoryHandle`.
- [`NodeFileSystemObserver`](src/NodeFileSystemObserver.ts) - A `FileSystemObserver` implementation backed by `fs.watch`.

[node-fs]: https://nodejs.org/api/fs.html
[fsa]: https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API
[observer]: https://developer.mozilla.org/en-US/docs/Web/API/FileSystemObserver

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