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

gfm-wasm

v1.0.1

Published

GitHub-flavored Markdown to safe HTML, powered by [cmark-gfm](https://github.com/github/cmark-gfm) compiled to WebAssembly. One small `.wasm`, no native modules, no generated glue. The same renderer runs on Node, Deno, Bun, Cloudflare Workers, and in the

Downloads

401

Readme

gfm-wasm

GitHub-flavored Markdown to safe HTML, powered by cmark-gfm compiled to WebAssembly. One small .wasm, no native modules, no generated glue. The same renderer runs on Node, Deno, Bun, Cloudflare Workers, and in the browser.

Output is sanitized by default: cmark-gfm runs in safe mode, so raw HTML is dropped and unsafe link schemes like javascript: and data:text/html are stripped. Untrusted Markdown stays harmless.

import { init, render } from 'gfm-wasm';
import wasm from 'gfm-wasm/wasm';

await init(wasm);
render('# Hello **world**'); // "<h1>Hello <strong>world</strong></h1>\n"

The gfm-wasm/wasm import resolves to the bundled module in whatever form your platform provides, and init accepts all of them. The snippet above runs as-is in Node, Deno, Bun, and the browser.

Install

npm install gfm-wasm

A prebuilt cmark.wasm is bundled, so there is no compiler or toolchain to set up.

API

init(source): Promise<void>

Instantiates the wasm. Call it once, await it, then render. source is anything you can load the module from:

  • string or URL, fetched for you
  • Response, or a promise resolving to one
  • ArrayBuffer or a typed array of raw bytes
  • a compiled WebAssembly.Module or WebAssembly.Instance

render(markdown): string

Renders Markdown to HTML, synchronously. Returns '' for empty input, and throws if called before init resolves.

Cloudflare Workers

Workers compile the wasm at deploy time, so instantiate once per isolate and reuse it across requests:

import { init, render } from 'gfm-wasm';
import wasm from 'gfm-wasm/wasm';

let ready: Promise<void> | undefined;

export default {
  async fetch(req: Request): Promise<Response> {
    ready ??= init(wasm);
    await ready;
    return new Response(render(await req.text()), {
      headers: { 'content-type': 'text/html; charset=utf-8' },
    });
  },
};

[!TIP] If your build fails to load the WebAssembly module, add the following rule to wrangler.json to ensure .wasm files are handled correctly.

{
  "rules": [
    {
      "type": "CompiledWasm",
      "globs": ["gfm-wasm/wasm"],
      "fallthrough": true
    }
  ]
}

Build from source

The published package already ships the wasm. To rebuild it, install the Emscripten SDK and run make. The output lands in dist/cmark.wasm.

License

MIT for this wrapper. cmark-gfm is © GitHub under its own license.