Ruby
asciichemasciichemasciichem-tsasciichem-pynpm install asciichemPublished to npm via trusted publishing (OIDC, no stored credentials) with SLSA provenance attestations — see the provenance on npm.
import { parse, parseSmiles, parseMolfile, renderMathml } from "asciichem";
// Same model as the Ruby reference — every format the gem emits, in// the browser or Node.parse("2H_2 + O_2 ->[heat] 2H_2O").toText();
parse("C1-C-C-C-C-C1").toStructuralSvg(); // cyclohexane hexagon
// Structures from databases, straight into the modelconst aspirin = parseSmiles("CC(=O)OC1=CC=CC=C1C(=O)O");aspirin.toStructuralSvg();aspirin.toSmiles(); // deterministic writer — round-trips exactly
parseMolfile(v2000Text); // coordinates preserved for rendering
// MathML goldens — byte-identical with the reference implementation.console.log(renderMathml(parse("^14C")));Parse / reject · L0 emission · L1 text · L2 MathML · SMILES · molfile — 100% of the shared corpus. See the Implementations matrix for the full table.
This is the package that powers this site’s live renderer and every diagram on this page. Highlights:
import.github.com/asciichem/asciichem-ts — powers this page.