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

@abhi1264/fastmd

v1.0.2

Published

High-performance markdown parser for Node.js and the browser

Downloads

22

Readme

fastmd

High-performance markdown parser for Node.js and the browser (Rust/WASM core).

Build

pnpm install
pnpm build:wasm   # build WASM (web + Node)
pnpm build       # compile TS and copy WASM into packages/fastmd/dist

Test

pnpm test        # unit tests; integration tests run when WASM is built

Benchmark

fastmd only:

pnpm build:wasm:node
pnpm bench

Compare vs react-markdown and Bun’s native markdown:

  1. Build WASM: pnpm build:wasm:node
  2. Optional: install react-markdown for comparison:
    pnpm add -D react-markdown react react-dom
  3. Run comparison (Node):
    pnpm bench:compare
  4. Or run under Bun (uses Bun’s runtime; Bun’s native markdown is included if your Bun version exposes it):
    bun run crates/fastmd-core/bench/compare.bench.ts

Same fixture and iteration count for all parsers; output is ops/sec so you can compare.

Usage

Node.js (sync, no init):

import { parseToTokens, renderHTML } from "@abhi1264/fastmd"
const tokens = parseToTokens("# Hello\n")
console.log(renderHTML(tokens, "# Hello\n"))  // <h1>Hello</h1>

Browser (async init once):

import initfastmd, { parseToTokens } from "@abhi1264/fastmd"
await initfastmd()
const tokens = parseToTokens("# Hello\n")

See docs/INIT.md and docs/STREAMING.md.

Supported syntax

| Feature | Supported | |--------|-----------| | Headings (#######) | ✅ | | Bold (** / __) | ✅ | | Italic (* / _) | ✅ | | ~~Strikethrough~~ (~~) | ✅ | | Code inline | ✅ | | Fenced code blocks (```) with optional language | ✅ | | Links | ✅ | | Autolinks <https://…> | ✅ | | Blockquotes (>) | ✅ | | Unordered lists (- / * / +) | ✅ | | Ordered lists (1. …) | ✅ | | Horizontal rule (--- / ***) | ✅ |

Not supported: raw HTML, tables, task lists, definition lists, footnotes, front matter. Use a full CommonMark/GFM parser if you need those.

Render options

renderHTML(tokens, src, options) accepts:

  • linkTarget – e.g. "_blank" for links
  • headingIdPrefix – prefix for heading id (slug from text)
  • codeClassPrefix – prefix for code block class (e.g. "language-" for syntax highlighting)

React components (optional)

For custom React components per element (like react-markdown):

import { parseToTokens, renderToReact } from "@abhi1264/fastmd/react"
const tokens = parseToTokens("# Hi\n")
const nodes = renderToReact(tokens, "# Hi\n", {
  a: (props) => <a {...props} target="_blank" />,
})

Requires react as peer. Import from fastmd/react.

Token format

Parse returns a flat Uint32Array: 4 u32 per token [kind, start, end, aux]. Use tokensFromBuffer(buf) to get Token[], or parseToTokens(md) for the full string → tokens pipeline. start/end are UTF-16 code unit offsets for correct src.slice(start, end) in JS.