No description
- JavaScript 100%
| src | ||
| test | ||
| .gitignore | ||
| package.json | ||
| README.md | ||
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
constants—VOCAB_KIND,TYPES,MARKERSoperations— pure tag-composition ops:setIdentifier,addPrefLabel,addRelation,composeTags, …blueprints— high-level builders:buildConceptScheme,buildConcept,buildCollectionparsers— reverse:parseConceptScheme,parseConcept
Test
node --test test/