cesr-ts
v0.3.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
npx cesr-annotate --in mystream.cesr --prettyDeno CLI usage (from source)
deno task cesr:annotate --in mystream.cesr --prettyBenchmarking (from source)
Run standard parser benchmark baselines:
deno task bench:cesrRun a benchmark on an arbitrary stream:
deno task bench:cesr:parser --in ../../samples/cesr-streams/CESR_1_0-oor-auth-vc.cesr
cat ../../samples/cesr-streams/CESR_1_0-oor-auth-vc.cesr | deno task bench:cesr:parser --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.
