@activefs/source-http
v0.1.0
Published
HTTP Source API v1 client and server helpers for ActiveFS remotes.
Maintainers
Readme
@activefs/source-http
HTTP Source API client and server helpers for ActiveFS remotes.
Use this package to expose an ActiveFSTree over HTTP or to consume a remote
Source API service as an ActiveFS tree.
Install
npm install @activefs/source-http @activefs/coreRequires Node.js 20 or newer.
Small Example
import { createActiveFS, fsTree, text } from "@activefs/core";
import {
createHttpSourceClient,
startActiveFSServer
} from "@activefs/source-http";
const tree = fsTree({
"/hello.txt": text("hello from Source API\n")
});
const server = await startActiveFSServer({ tree });
try {
const remote = createHttpSourceClient({ url: server.url });
const activefs = createActiveFS().mount("/remote", remote);
const file = await activefs.read({}, "/remote/hello.txt");
console.log(file.content);
} finally {
await server.close();
}What It Owns
- Source API v1 HTTP client and server helpers.
- Capability and handshake documents.
- Source API session and freshness helpers.
- Wire-level error mapping into ActiveFS errors.
This package is a protocol adapter. It does not provide hosted storage or a hosted ActiveFS service.
Docs
- Source API: https://github.com/ankitparasher/activefs/blob/main/docs/reference/source-api.md
- HTTP transport: https://github.com/ankitparasher/activefs/blob/main/docs/reference/source-http-transport.md
- Connect a source: https://github.com/ankitparasher/activefs/blob/main/docs/guides/connect-a-source.md
