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

rs-markdown-parser

v1.0.0

Published

A Node.js module for converting Markdown files to HTML using Rust, powered by the `pulldown-cmark` library and Neon bindings.

Downloads

16

Readme

rs-markdown-parser

A Node.js module for converting Markdown files to HTML using Rust, powered by the pulldown-cmark library and Neon bindings.

Features

  • Fast Markdown to HTML conversion using Rust's pulldown-cmark.
  • Optional GitHub Flavored Markdown (GFM) support for tables, footnotes, strikethrough, task lists, and heading attributes.
  • Exports HTML as an ES module for easy integration.
  • TypeScript support with type definitions.

Installation

  1. Install the package:

    npm install rs-markdown-parser
  2. Build the module (if modifying source):

    • For development (debug build):
      npm run debug
    • For production (release build):
      npm run build
    • For cross-compilation (if targeting different platforms):
      npm run cross

    The build process compiles the Rust code into a native Node.js module (index.node).

Usage

The module exports a single function, processMarkdown, which converts a Markdown file to HTML and returns it as an ES module string.

Parameters

  • filePath (string): The file path to the Markdown file (e.g., "./test.md"). Must be a valid path to an existing file.
  • gfm (boolean): Enables GitHub Flavored Markdown features. Set to true to support tables, footnotes, strikethrough, task lists, and heading attributes; false for standard Markdown.

JavaScript Example

const { processMarkdown } = require("rs-markdown-parser");
const { join } = require("path");

const filePath = join(__dirname, "./test.md");
const result = processMarkdown(filePath, false);

console.log(result); // Outputs: export default `<html_content>`;

TypeScript Example

import { processMarkdown } from "rs-markdown-parser";
import { join } from "path";

const filePath: string = join(__dirname, "./test.md");
const result: string = processMarkdown(filePath, false);

console.log(result); // Outputs: export default `<html_content>`;

Example Markdown File (test.md)

# Hello, World!

This is a **Markdown** file.

- Item 1
- Item 2

Output

export default `<h1>Hello, World!</h1>\n<p>This is a <strong>Markdown</strong> file.</p>\n<ul>\n<li>Item 1</li>\n<li>Item 2</li>\n</ul>`;

Using with GFM

To enable GitHub Flavored Markdown features:

const result = processMarkdown(filePath, true);

This enables support for:

  • Tables
  • Footnotes
  • Strikethrough
  • Task lists
  • Heading attributes

TypeScript Support

This module includes TypeScript type definitions in index.d.ts. To use with TypeScript:

  1. Ensure TypeScript is installed:

    npm install -g typescript
  2. Include the module in your TypeScript project:

    npm install rs-markdown-parser
  3. The type definitions are automatically picked up from index.d.ts when you import the module.

Development

  • Run tests:

    npm run test
  • Rebuild after changes: Modify the Rust code in src/lib.rs or TypeScript definitions in index.d.ts and run npm run debug or npm run build.

License

MIT License. See LICENSE for details.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

Issues

Report bugs or request features on the GitHub Issues page.