npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

okf-core

v3.0.1

Published

Canonical parser, validator, link resolver, graph, and search engine for OKF v0.2

Readme

okf-core

okf-core is the storage-neutral OKF v0.2 library. It analyzes an in-memory list of bundle-relative Markdown documents and returns okf.inspect.v1.

import { analyzeBundle } from "okf-core";

const analysis = analyzeBundle(documents, {
  today: "2026-08-20",
  profile: consumerProfile,
});

Analysis does not depend on a clock, filesystem, network, registry, or second bundle. The library retains YAML source byte-for-byte beside its parsed mapping and reads Markdown links from a CommonMark AST. Conformance errors, format guidance, and consumer profile findings remain separate throughout the result.

Generated directory indexes

generateBundleIndexes(analysis) returns one okf.index.v1 navigation object per directory. selectBundleIndex(indexes, directory) selects the root (.) or a confined bundle-relative directory. Each index contains its immediate pages' titles and descriptions, child directories, and rendered Markdown. The root Markdown retains the analyzed okf_version declaration; nested indexes have no frontmatter. Neither function writes to storage.

Indexes and logs are excluded from buildGraph. Navigation entries are not semantic relationships. Useful prose previously kept in a reserved index.md belongs in an ordinary typed page before an authored index is retired.

Metadata and profile boundaries

content, frontmatter.raw, and frontmatter.yaml retain authored bytes. The metadata field is the JSON-safe projection used by okf.inspect.v1: all unknown keys and JSON values are retained, non-cyclic aliases are expanded by value, and unsafe mappings such as cyclic aliases or non-finite numbers produce a deterministic core.*.frontmatter.non-json error. The original content remains available even when no parsed snapshot can be emitted.

Profiles are untrusted extensions at this boundary. The engine fixes their diagnostic family and profile ID, supplies the default error severity, sanitizes valid source ranges, and throws a deterministic TypeError for an invalid result before returning a partial BundleAnalysis.

Trust timestamps use deterministic syntax checks: an ISO 8601 datetime must include seconds and either Z or an explicit numeric offset. Existing YYYY-MM-DD values remain accepted as a compatibility form. Actor-convention violations (<producer>/<version>, human:<id>, or process:<id>) are soft guidance, not core conformance failures.

Reserved-file conformance is structural. Heading and list checks use a CommonMark tree, so examples inside code fences do not count. Every log.md requires H2 YYYY-MM-DD groups in newest-first order, and each group requires at least one top-level list of entries before the next H2.