foam-core
v0.43.1
Published
Platform-agnostic core logic for Foam
Readme
@foam/core
Platform-agnostic core library for Foam. Contains the business logic, data models, and services that power Foam, with no dependency on VS Code or any specific runtime environment.
What's inside
- Workspace & graph —
FoamWorkspaceandFoamGraphmanage resources and their connections - Markdown parsing — parse notes, extract links, tags, frontmatter, and blocks
- Resource providers —
MarkdownResourceProviderandAttachmentResourceProviderfor pluggable file type support - Note creation — template engine, variable resolution, and daily note support
- Query engine — DQL and JS-based queries for embedding dynamic content in notes
- Link integrity — compute rename edits for wikilinks and markdown links
- Utilities — logging, slugs, hashtags, path helpers, and more
Usage
import { bootstrap, FoamWorkspace, FoamGraph } from '@foam/core';This package is consumed by foam-vscode and is designed to be reusable in other environments (CLI, web, mobile).
Development
From the repo root:
yarn workspace @foam/core test:unit # run unit tests
yarn workspace @foam/core build # compile TypeScript
yarn workspace @foam/core lint # lint