No description
  • JavaScript 100%
Find a file
2026-04-17 22:15:08 +02:00
src feat: extract kind-39737 primitives from nocabs 2026-04-17 22:15:08 +02:00
test feat: extract kind-39737 primitives from nocabs 2026-04-17 22:15:08 +02:00
.gitignore feat: extract kind-39737 primitives from nocabs 2026-04-17 22:15:08 +02:00
package.json feat: extract kind-39737 primitives from nocabs 2026-04-17 22:15:08 +02:00
README.md feat: extract kind-39737 primitives from nocabs 2026-04-17 22:15:08 +02:00

nostr-vocab-core

Pure-JS primitives for NIP-VOCAB (kind 39737): ConceptSchemes, Concepts, Collections.

Zero runtime deps. Works in node and browsers. Used by the nocabs editor and the edufeed-app form renderer.

Install

pnpm add git+https://git.edufeed.org/edufeed/nostr-vocab-core.git#v0.1.0

Usage

import { buildConceptScheme, buildConcept, VOCAB_KIND } from 'nostr-vocab-core';

const scheme = buildConceptScheme({
  d: 'my-vocab',
  prefLabels: [{ value: 'My Vocab', lang: 'en' }]
});

See src/blueprints.js for the full input shape.

Exports

  • constantsVOCAB_KIND, TYPES, MARKERS
  • operations — pure tag-composition ops: setIdentifier, addPrefLabel, addRelation, composeTags, …
  • blueprints — high-level builders: buildConceptScheme, buildConcept, buildCollection
  • parsers — reverse: parseConceptScheme, parseConcept

Test

node --test test/