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

@glyphmark/core

v1.1.0

Published

Parser and renderer for the .glyph DSL — produces Pathfinder 2e-styled HTML/PDF

Readme

@glyphmark/core

Parser and renderer for the .glyph markup language — produces self-contained HTML and PDF documents styled to match the Pathfinder 2e rulebook layout.

This is the engine behind the @glyphmark/cli tool. Use this package directly if you want to embed the renderer in a web playground, editor plugin, docs site, or anything else that already runs JS.

Install

npm install @glyphmark/core

renderToPdf additionally needs Playwright at runtime (it's declared as an optional peer):

npm install playwright
npx playwright install chromium

If you only need renderToHtml, skip the Playwright install.

Quick start

import { parseGlyph, renderToHtml, renderToPdf } from '@glyphmark/core';
import fs from 'node:fs';

const source = fs.readFileSync('example.glyph', 'utf-8');
const doc = parseGlyph(source);

// HTML — synchronous, returns a self-contained string with inlined styles
fs.writeFileSync('example.html', renderToHtml(doc));

// PDF — async, returns a Buffer (requires Playwright)
fs.writeFileSync('example.pdf', await renderToPdf(doc));

API

parseGlyph(input: string): GlyphDocument

Parses a .glyph source string into an intermediate document tree. Throws on syntax errors with line/column information.

renderToHtml(doc: GlyphDocument): string

Renders a parsed document to a complete HTML string. Output is self-contained — fonts, styles, and ornaments are all inlined, so the result can be served or saved as a single file.

renderToPdf(doc: GlyphDocument): Promise<Buffer>

Renders to PDF by spinning up a headless Chromium via Playwright and printing the HTML. Returns a Buffer containing the PDF bytes. Playwright is a peer dependency — install it separately if you need this function.

Types

GlyphDocument and BodyNode are exported for callers that want to inspect or transform the IR between parsing and rendering.

License

Elastic License 2.0. Free for personal and internal use; you may not offer this package to third parties as a hosted or managed service.