Files
notification-elements-demo/node_modules/@jsonjoy.com/fs-node
Giuliano Silvestro 5d0c9ec7eb Initial commit: notification-elements-demo app
Interactive Angular 19 demo for @sda/notification-elements-ui with
6 sections: Bell & Feed, Notification Center, Inbox, Comments &
Threads, Mention Input, and Full-Featured layout. Includes mock
data, dark mode toggle, and real-time event log.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 21:49:19 +10:00
..

@jsonjoy.com/fs-node

In-memory filesystem with Node.js fs-compatible API.

Installation

npm install @jsonjoy.com/fs-node

Usage

import { Volume } from '@jsonjoy.com/fs-node';

const vol = new Volume();
vol.writeFileSync('/hello.txt', 'Hello, World!');
console.log(vol.readFileSync('/hello.txt', 'utf8')); // Hello, World!

Create filesystem from JSON

import { Volume } from '@jsonjoy.com/fs-node';

const vol = Volume.fromJSON({
  '/app/index.js': 'console.log("Hello");',
  '/app/package.json': '{"name": "app"}',
});

console.log(vol.readdirSync('/app')); // ['index.js', 'package.json']

API

The Volume class implements Node.js fs module's synchronous and callback APIs:

  • readFile, readFileSync
  • writeFile, writeFileSync
  • mkdir, mkdirSync
  • readdir, readdirSync
  • stat, statSync
  • unlink, unlinkSync
  • ... and many more

It also exposes a promises property for the Promise-based API:

const data = await vol.promises.readFile('/hello.txt', 'utf8');

License

Apache-2.0