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

@quillmark-test/web

v1.1.0

Published

Opinionated frontend utilities for Quillmark WASM

Downloads

81

Readme

@quillmark-test/web

Frontend utilities for rendering Quillmark documents in the browser

Clean, type-safe API for loading Quillmark templates and rendering to PDF/SVG.

Installation

npm install @quillmark-test/web

Quick Start

Render to PDF

import { Quillmark, loaders, exporters } from '@quillmark-test/web';

// Load template
const response = await fetch('/templates/letter.zip');
const quill = await loaders.fromZip(await response.blob());

// Setup engine
const engine = new Quillmark();
engine.registerQuill(quill);

// Render and download
const markdown = '# Hello World\n\nMy first document!';
const result = exporters.render(engine, markdown, { format: 'pdf' });
exporters.download(result, 'output.pdf');

Get SVG String (Primary Use Case)

import { Quillmark, loaders, exporters } from '@quillmark-test/web';

// Setup
const quill = await loaders.fromZip(await fetch('/templates/letter.zip').then(r => r.blob()));
const engine = new Quillmark();
engine.registerQuill(quill);

// Get SVG string to inject into your own widgets/components
const result = exporters.render(engine, markdown);  // Defaults to SVG
const svgString = new TextDecoder().decode(result.artifacts.main);

// Use in your application
myCustomWidget.innerHTML = svgString;
document.getElementById('preview').innerHTML = svgString;

Live Preview with toElement()

// Alternative: Use toElement() for quick demos/playgrounds
const editor = document.querySelector('#editor');
const preview = document.querySelector('#preview');

editor.addEventListener('input', () => {
  const result = exporters.render(engine, editor.value);
  exporters.toElement(result, preview);  // Handles SVG/PDF automatically
});

API

loaders.fromZip(blob: Blob)

Load a Quill template from a zip file.

const quill = await loaders.fromZip(zipBlob);
engine.registerQuill(quill);

exporters.render(engine, markdown, options?)

Render markdown to a standardized result.

const result = exporters.render(engine, markdown, {
  format: 'pdf',      // 'pdf' | 'svg' (defaults to svg)
  quillName: 'letter' // optional: override detected quill
});

Returns: RenderResult with standardized format

{
  artifacts: { main: Uint8Array },
  outputFormat: 'pdf' | 'svg'
}

Export Functions

All export functions accept RenderResult from render():

// Get SVG string (primary use case - direct access)
const svgString = new TextDecoder().decode(result.artifacts.main);
myWidget.innerHTML = svgString;

// Get Blob (for upload, storage, etc.)
const blob = exporters.toBlob(result);

// Get data URL
const dataUrl = await exporters.toDataUrl(result);

// Inject into DOM element (convenience for demos)
exporters.toElement(result, containerElement);

// Download as file
exporters.download(result, 'document.pdf');

Pattern: Render Once, Export Many

const result = exporters.render(engine, markdown, { format: 'pdf' });

// Export to multiple formats without re-rendering
const blob = exporters.toBlob(result);
const dataUrl = await exporters.toDataUrl(result);
exporters.download(result, 'document.pdf');

Utilities

import { utils } from '@quillmark-test/web';

// Debounce for live preview
editor.addEventListener('input', utils.debounce(() => {
  const result = exporters.render(engine, editor.value);
  exporters.toElement(result, preview);
}, 300));

// Detect binary files (for custom loaders)
if (utils.detectBinaryFile('image.png')) {
  // Handle as binary
}

TypeScript

Full type definitions included:

import type {
  RenderResult,
  RenderOptions,
  RenderFormat,
  QuillJson,
  QuillInfo
} from '@quillmark-test/web';

Quill Template Format

Templates are zip files containing:

  • Quill.toml - Template configuration
  • glue.typ - Typst template
  • assets/ - Fonts, images, etc.
  • packages/ - Typst packages

When loaded via fromZip(), they become QuillJson:

{
  files: {
    'Quill.toml': { contents: '...' },
    'glue.typ': { contents: '...' },
    'assets': {
      'font.otf': { contents: [137, 80, ...] }  // Binary as number array
    }
  }
}

Browser Support

  • Modern browsers with WebAssembly support
  • ES2020+
  • No polyfills required

Playground

This repository also includes an interactive playground:

git clone https://github.com/nibsbin/quillmark-web.git
cd quillmark-web
npm install
npm run dev

Visit http://localhost:5173 for a live editor with template selection and real-time preview.

Version

v1.0.0 - Stable API with simplified architecture

License

Apache-2.0