Package Exports
- @femtomc/mu-core
- @femtomc/mu-core/browser
- @femtomc/mu-core/node
Readme
@femtomc/mu-core
Core types and utilities shared across mu packages: JSONL store abstractions, event logging, DAG helpers, and spec schemas.
Install
After publishing:
npm install @femtomc/mu-core
# or: bun add @femtomc/mu-coreFrom this repo:
cd mu
bun install
bun run buildUsage
import { EventLog, InMemoryJsonlStore, JsonlEventSink, newRunId, runContext } from "@femtomc/mu-core/node";
const jsonl = new InMemoryJsonlStore();
const events = new EventLog(new JsonlEventSink(jsonl));
await runContext({ runId: newRunId() }, async () => {
await events.emit("demo.event", { source: "readme", payload: { ok: true } });
});
console.log(await jsonl.read());Tests / Typecheck
From the mu/ repo root:
bun test packages/core
bun run typecheckRuntime
@femtomc/mu-coreis runtime-agnostic (no Node builtins).@femtomc/mu-core/nodeis Node-only (node:fs,node:async_hooks).@femtomc/mu-core/browseris browser-only (IndexedDB/localStorage).