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

manus-markdown-to-html

v1.0.1

Published

Fast and lightweight markdown to HTML converter - Convert markdown to HTML, extract table of contents, strip formatting

Readme

Manus Markdown to HTML

Fast and lightweight markdown to HTML converter for Node.js. Convert markdown to HTML, extract table of contents, and strip formatting.

Features

  • Fast conversion - Lightweight regex-based converter
  • Full markdown support - Headers, bold, italic, links, images, code, lists
  • Table of contents - Extract headers with IDs
  • Strip formatting - Remove all markdown formatting
  • Sanitization - Optional HTML escaping
  • Customizable - Configure link targets and options
  • Zero dependencies - No external libraries needed

Installation

npm install manus-markdown-to-html

Quick Start

const { convert, stripMarkdown, getTableOfContents } = require('manus-markdown-to-html');

// Convert markdown to HTML
const html = convert('# Hello\n\nThis is **bold** text');
// <h1>Hello</h1><p>This is <strong>bold</strong> text</p>

// Get table of contents
const toc = getTableOfContents('# Title\n## Section 1\n## Section 2');
// [{ level: 1, text: 'Title', id: 'title' }, ...]

// Strip markdown
const text = stripMarkdown('**Bold** and *italic*');
// Bold and italic

Advanced Usage

const { MarkdownToHTML } = require('manus-markdown-to-html');

const converter = new MarkdownToHTML({
  breaks: true,
  linkTarget: '_self',
  sanitize: true
});

const html = converter.convert(markdown);
const toc = converter.getTableOfContents(markdown);
const text = converter.stripMarkdown(markdown);

Supported Markdown

  • Headers - # H1, ## H2, ### H3
  • Bold - **bold** or __bold__
  • Italic - *italic* or _italic_
  • Code - `inline` or ``` code block ```
  • Links - [text](url)
  • Images - ![alt](url)
  • Lists - - item or * item or 1. item
  • Blockquotes - > quote
  • Horizontal rule - --- or *** or ___

API Reference

MarkdownToHTML Class

constructor(options)

  • breaks (boolean, default: true) - Convert line breaks to <p> tags
  • linkTarget (string, default: '_blank') - Target for links
  • sanitize (boolean, default: true) - Escape HTML characters

convert(markdown)

Convert markdown to HTML.

getTableOfContents(markdown)

Extract headers as table of contents.

stripMarkdown(markdown)

Remove all markdown formatting.

Convenience Functions

  • convert(markdown, options) - Convert markdown to HTML
  • stripMarkdown(markdown) - Strip markdown formatting
  • getTableOfContents(markdown) - Extract table of contents

Examples

Blog Post Processing

const { convert, getTableOfContents } = require('manus-markdown-to-html');

const post = `
# My Blog Post

## Introduction
This is the intro.

## Content
Main content here.
`;

const html = convert(post);
const toc = getTableOfContents(post);

Documentation Generator

const { convert, stripMarkdown } = require('manus-markdown-to-html');

const markdown = fs.readFileSync('README.md', 'utf8');
const html = convert(markdown);
const plainText = stripMarkdown(markdown);

Email Generation

const { convert } = require('manus-markdown-to-html');

const emailBody = `
Hi **John**,

Here's the update:

- Item 1
- Item 2

[Click here](https://example.com) for more info.
`;

const html = convert(emailBody);

Performance

  • Converts 1000+ documents per second
  • Minimal memory footprint
  • No external dependencies
  • Optimized regex patterns

Options

{
  breaks: true,           // Convert \n\n to <p> tags
  linkTarget: '_blank',   // Target for links
  sanitize: true          // Escape HTML
}

License

MIT License

Support

For issues and questions: https://github.com/kokashinobi/manus-ai-tools/issues


Made with ❤️ by Manus AI