cesr-ts
v0.9.1
Published
CESR parser, primitives, and annotation tooling for TypeScript/JavaScript
Readme
cesr-ts
TypeScript/JavaScript CESR package for parser primitives, stream parsing, and CESR annotation.
Install
npm install cesr-tsLibrary quick start
import { annotate, createParser } from "cesr-ts";
const parser = createParser();
const out = parser.feed(new TextEncoder().encode("...CESR..."));
const last = parser.flush();
const text = "{\"v\":\"KERI10JSON00002e_\",\"t\":\"rpy\",\"d\":\"Eabc\"}";
const annotated = annotate(text, { domainHint: "txt", pretty: true });CLI usage
npm exec --package cesr-ts -- tephra annotate --in mystream.cesr --pretty
npm exec --package cesr-ts -- tephra validate --in mystream.cesr
npm exec --package cesr-ts -- tephra bench --in mystream.cesr --iterations 20 --warmup 3After global install:
tephra annotate --in mystream.cesr --pretty
tephra validate --in mystream.cesr
tephra bench --in mystream.cesr --iterations 20 --warmup 3Deno CLI usage (from repository root)
deno task tephra:annotate --in mystream.cesr --pretty
deno task tephra:validate --in mystream.cesrBenchmarking (from repository root)
Run standard parser benchmark baselines:
deno task bench:cesrRun a benchmark on an arbitrary stream:
deno task tephra:bench --in ../../samples/cesr-streams/CESR_1_0-oor-auth-vc.cesr
cat ../../samples/cesr-streams/CESR_1_0-oor-auth-vc.cesr | deno task tephra:bench --iterations 20 --warmup 3Using cesr-ts through tufa
keri-ts exposes CESR annotation through tufa annotate, which is often the
easiest on-ramp:
tufa version
tufa annotate --in mystream.cesr --prettyLicense
Licensed under the Apache License, Version 2.0 (Apache-2.0). See the top-level
LICENSE file in this repository.
