Glossarist-js 0.2 introduces comprehensive GCR package support to the JavaScript SDK.
GCR package read/write
The SDK now supports full read and write operations on GCR (Glossarist Concept Registry) packages — ZIP archives containing concept YAML files, compiled machine formats, bibliography data, and images.
js
import { loadGcr, createGcr } from 'glossarist';
// Read
const pkg = await loadGcr(fs.readFileSync('dataset.gcr'));
await pkg.eachConcept((concept) => {
console.log(concept.id, concept.primaryDesignation('eng'));
});
// Write
const buf = await createGcr([concept], { shortname: 'my-dataset' });Compiled formats
GCR packages can contain pre-compiled machine formats (TBX, JSON-LD, Turtle, JSONL). The SDK provides methods to discover, read, and write these formats.
Install
bash
npm install glossaristSee the glossarist-js documentation for full usage details.