@activefs/core
v0.1.0
Published
Core ActiveFS contracts, router, errors, source capabilities, shared path/content helpers, and cache-aware runtime types.
Maintainers
Readme
@activefs/core
Core ActiveFS runtime, tree contracts, path helpers, errors, capabilities, and filesystem-shaped operations.
Use this package to define dynamic ActiveFSTree implementations and mount
them into an ActiveFS runtime.
Install
npm install @activefs/coreRequires Node.js 20 or newer.
Small Example
import { createActiveFS, fsTree, json, text } from "@activefs/core";
const tree = fsTree({
"/README.md": text("# Hello from ActiveFS\n"),
"status.json": json(() => ({ ok: true, generatedAt: new Date().toISOString() }))
});
const activefs = createActiveFS().mount("/", tree);
const entries = await activefs.list({}, "/");
const readme = await activefs.read({}, "/README.md");
console.log(entries.map((entry) => entry.path));
console.log(readme.content);What It Owns
- ActiveFS paths and runtime routing.
ActiveFSTreeauthoring helpers such asfsTree,dir,text,bytes, andjson.- Generic read, list, stat, search, write, delete, rename, copy, truncate, and watch contracts.
- Stable error classes and content/path helpers.
Core is intentionally generic. It forwards opaque auth and metadata to tree implementations; trees and Source API servers own final policy decisions.
Docs
- Core API: https://github.com/ankitparasher/activefs/blob/main/docs/reference/core-api.md
- Concepts: https://github.com/ankitparasher/activefs/blob/main/docs/concepts.md
- Source API: https://github.com/ankitparasher/activefs/blob/main/docs/reference/source-api.md
