Core filesystem primitives for building in-memory and virtual filesystems.
This package provides the core data structures for representing a virtual filesystem:
npm install @jsonjoy.com/fs-core
import { Superblock, DirectoryJSON } from '@jsonjoy.com/fs-core';
// Create a new filesystem
const fs = new Superblock();
// Or create from a JSON structure
const json: DirectoryJSON = {
'/file.txt': 'Hello, World!',
'/dir/nested.txt': 'Nested content',
};
const fs = Superblock.fromJSON(json);