@activefs/local
v0.1.0
Published
Local ActiveFS tree, export, cache, invalidation, and filesystem helper utilities.
Downloads
31
Maintainers
Readme
@activefs/local
Local filesystem-backed ActiveFS tree helpers, cache utilities, and export helpers.
Use this package to expose a real directory as an ActiveFS tree or to copy an ActiveFS tree to a normal directory.
Install
npm install @activefs/local @activefs/coreRequires Node.js 20 or newer.
Small Example
import { createActiveFS } from "@activefs/core";
import { createLocalTree, exportTree } from "@activefs/local";
const tree = createLocalTree({
root: "./docs",
readonly: true
});
const activefs = createActiveFS().mount("/docs", tree);
const entries = await activefs.list({}, "/docs");
console.log(entries.map((entry) => entry.path));
await exportTree(tree, "./exported-docs");What It Owns
createLocalTreefor local directory-backed trees.- Local read/list/stat cache helpers.
- Live export helpers such as
exportTreeandwatchExportTree. - File watcher integration for local tree invalidation.
The local tree rejects path escapes from its configured root. Mutation methods are only enabled when the tree is not created as readonly.
Docs
- Export: https://github.com/ankitparasher/activefs/blob/main/docs/guides/export.md
- Cache and freshness: https://github.com/ankitparasher/activefs/blob/main/docs/guides/cache-and-freshness.md
- Core API: https://github.com/ankitparasher/activefs/blob/main/docs/reference/core-api.md
