New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@okforest/okf

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@okforest/okf

Read an Open Knowledge Format (OKF) v0.2 tree into a model: concepts, frontmatter, links, backlinks, trust tiers, staleness, and a metadata inventory. No SDKs or frameworks; runs in Node, browsers, and Workers.

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

@okforest/okf

Read an Open Knowledge Format (OKF) v0.2 tree into a model: concepts (path, concept ID, frontmatter, body as mdast), reserved index.md and log.md files, links in both absolute and relative forms, backlinks, and the v0.2 fields with their derived values: trust tier, lifecycle status, and staleness. Also builds the metadata inventory: every type, tag, and frontmatter key in use, with near-duplicates.

No SDKs or frameworks: the core is pure and runs in Node, browsers, and Workers. Reading from disk is a separate entry point.

import { buildInventory } from "@okforest/okf"
import { readTree } from "@okforest/okf/node"

const tree = await readTree("./sales-okf")
const orders = tree.concept("tables/orders")
orders?.trustTier // "unverified" | "machine-confirmed" | "human-reviewed"
orders?.isStale() // now >= stale_after
tree.backlinks("tables/orders") // links from other concepts
buildInventory(tree).nearDuplicates // e.g. e-commerce ~ ecommerce

Without a file system, pass the files yourself:

import { parseTree } from "@okforest/okf"

const tree = parseTree([
  { path: "index.md", text: '---\nokf_version: "0.2"\n---\n# Tables\n' },
  { path: "tables/orders.md", text: "---\ntype: BigQuery Table\n---\n# Schema\n" },
])

Parsing never throws on malformed content: problems are recorded on each file (frontmatterError) for @okforest/validate to report.

Part of the OKForest CLI · Apache-2.0 · © Preneur LLC

Keywords

okf

FAQs

Package last updated on 12 Oct 2026

Related posts