npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@datagrok-libraries/hwe

v1.0.0

Published

Standalone TypeScript HELM Web Editor: parser, renderer, interactive editor, and headless service.

Readme

@datagrok-libraries/hwe

A standalone TypeScript HELM Web Editor — parse, render, edit, and compute on biopolymers (peptides, RNA/DNA, CHEM, conjugates) written in HELM notation. No framework, no DOM globals required: a headless service for parsing/rendering/calculations, plus a full interactive editor you can drop into any page.

HELM editor — peptide

HELM editor — RNA

Features

  • Parser & serializer — HELM V2.0 in/out, lenient or strict, with structured validation diagnostics.
  • Renderer — crisp SVG (and canvas) drawing: monomer shapes, bonds, cyclic/branched layouts, RNA cloverleaves, 5′/3′ direction markers, serpentine wrapping for long chains.
  • Interactive editor — palette, toolbar, drag-to-add, bond/monomer dialogs, undo/redo, zoom/pan, find & replace, light/dark themes.
  • Calculations — molecular formula, weight, extinction coefficient, pseudo-molfile.
  • Headless — every non-interactive feature runs in Node (SSR, batch, grid cell rendering) with no browser.
  • Datagrok adapter — drop-in integration via the @datagrok-libraries/hwe/datagrok entry point.

Install

npm install @datagrok-libraries/hwe

Ships as ESM + CJS with TypeScript declarations.

Quick start

Headless: parse, render, compute

import { HelmService, MonomerLib } from '@datagrok-libraries/hwe';

// Load a monomer library (HELMCoreLibrary JSON, your own, or empty()).
const lib = MonomerLib.empty();              // or MonomerLib.fromText(json)
const svc = new HelmService({ monomerLib: lib });

const helm = 'PEPTIDE1{A.C.D.E.F.G}$$$$';

const svg = svc.renderToSvg(helm, { width: 600, height: 200 });
const { mol, diagnostics } = svc.parse(helm);
const issues = svc.validate(helm);           // ValidationDiagnostic[]
const weight = svc.getMolWeight(helm);       // needs a real library for accuracy
const formula = svc.getFormula(helm);

Calculations and atomic structures need a real monomer library (weights are 0 against empty()). Load one with MonomerLib.fromText(json), MonomerLib.fromJSON(obj), or await MonomerLib.fromUrl(url).

Interactive editor

import { HelmService, MonomerLib, HelmEditorApp } from '@datagrok-libraries/hwe';
import '@datagrok-libraries/hwe/styles.css';   // editor stylesheet

const lib = await MonomerLib.fromUrl('/HELMCoreLibrary.json');
const service = new HelmService({ monomerLib: lib });

const app = new HelmEditorApp(document.getElementById('editor')!, {
  service,
  initialHelm: 'PEPTIDE1{A.C.D.E.F.G}$$$$',
});

app.setHelm('RNA1{r(A)p.r(C)p.r(G)p.r(U)p}$$$$V2.0');
const current = app.getHelm();                // read it back

The editor surfaces structure (atomic) previews on hover when you pass an RDKit module to the service:

const service = new HelmService({ monomerLib: lib, rdkitModule });

Theming

import { lightTheme, darkTheme, defineTheme } from '@datagrok-libraries/hwe';

new HelmEditorApp(host, { service, theme: darkTheme });

Datagrok

The @datagrok-libraries/hwe/datagrok entry exposes the adapter used by the Datagrok Helm package (helper registration, editor/app/input wrappers, monomer-library bridge):

import { registerWithDatagrok } from '@datagrok-libraries/hwe/datagrok';

const { adapter, unsubscribe } = registerWithDatagrok(grok, { service });

@datagrok-libraries/bio is an optional peer dependency — the adapter expects the Datagrok runtime to provide it.

Package entry points

| Import | Contents | | --- | --- | | @datagrok-libraries/hwe | Core: service, parser, renderer, editor, calculations | | @datagrok-libraries/hwe/datagrok | Datagrok adapter | | @datagrok-libraries/hwe/styles.css | Editor stylesheet (interactive UI) |

License

GPL-3.0-only. Bundled third-party components (lru-cache, Lucide icon paths) retain their own licenses — see THIRD-PARTY-NOTICES.txt.