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 🙏

© 2025 – Pkg Stats / Ryan Hefner

rmmd

v2.3.0

Published

Lightweight command-line tool to convert Markdown into HTML. Built on unified.js.

Downloads

214

Readme

rmmd

rmmd is a lightweight command-line tool to convert Markdown into HTML. It supports standard input, file processing, and advanced options for wrapping output in a full HTML document. Built on unified.js.

  1. Features
  2. Installation
  3. Usage
  4. Examples
  5. Output Formats
  6. Error Handling
  7. Developer Notes
  8. Contributing
  9. License

  • Convert Markdown to HTML: Quickly process Markdown files or input streams into semantic HTML.
  • Flexible Input Options: Provide input via a file, stdin, or direct piping from another command.
  • File Output: Write the output to a file using the --file or -f option.
  • Full HTML Document Wrapping: Use the --enclose or -e option to wrap the HTML content in a complete, standards-compliant HTML document.
  • Command-line Options:
    • Process a file or piped content by default.
    • --file (-f): Specify a file to write the output.
    • --enclose (-e): Wrap output in a fully compliant HTML document.
    • --version (-v): Output the version.
    • --help (-h): Display help information.
    • Use --custom (-c) to enable custom syntax processing.
    • Leave out --custom to process only basic Markdown.
  • Modern Web Standards: Outputs valid HTML5 for browser compatibility.
  • Custom Markup Syntax:
    • = wraps text in <mark>:
      This is =marked text= in markdown.
      Produces:
      <p>This is <mark>marked text</mark> in markdown.</p>
    • + wraps text in <dfn>:
      This is +a definition text+ in markdown.
      Produces:
      <p>This is <dfn>a definition text</dfn> in markdown.</p>
    • ~ wraps text in <s>:
      This is ~a styled text passage~ in markdown.
      Produces:
      <p>This is <s>a styled text passage</s> in markdown.</p>

Installation

Install rmmd globally using npm:

npm install -g rmmd

This makes the rmmd command available globally on your system.

Usage

Basic Conversion

Convert a Markdown file to HTML:

rmmd example.md

Piping Markdown Content

Pipe Markdown content directly into rmmd:

cat example.md | rmmd

Write to a File

Use the --file or -f option to specify an output file:

rmmd example.md -f output.html

Wrap Output in an HTML Document

Use the --enclose or -e option to wrap the output in a complete HTML document:

rmmd example.md -e

Combine it with file output:

rmmd example.md -e -f wrapped.html

Display Version and Help

Check the version:

rmmd -v

Display help:

rmmd -h
  1. Convert Markdown to HTML and print to stdout:
    rmmd example.md
  2. Convert Markdown and write output to a file:
    rmmd example.md -f result.html
  3. Convert Markdown, wrap in an HTML document, and print:
    rmmd example.md -e
  4. Convert, wrap, and save to a file:
    rmmd example.md -e -f full-document.html
  5. Pipe Markdown content into rmmd and wrap in a document:
    cat example.md | rmmd -e
  6. Convert Markdown to HTML with basic syntax:
    rmmd example.md
  7. Convert Markdown to HTML with custom syntax:
    rmmd example.md --custom
  8. Wrap the output in an HTML document:
    rmmd example.md --enclose
  9. Combine custom syntax, file output, and HTML wrapping:
    rmmd example.md --custom --enclose --file output.html

Default HTML Output

By default, the tool converts Markdown to clean HTML:

<h1>Hello, World</h1>
<p>This is Markdown rendered as HTML.</p>

Enclosed HTML Output

Using the --enclose option wraps the output in a valid HTML document:

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Markdown Output</title>
</head>
<body>
  <h1>Hello, World</h1>
  <p>This is Markdown rendered as HTML.</p>
</body>
</html>

The tool provides helpful error messages:

  • If no input is provided:
    No input provided. Use a file path or pipe Markdown content.
  • If the specified file does not exist:
    Error: ENOENT: no such file or directory, open 'example.md'
  • If invalid options are passed:
    error: unknown option '--invalid'

The tool is modular, using separate libraries for Markdown processing and HTML wrapping. It follows modern ESM standards.

Project Structure

rmmd/
|-- bin/
|   |-- rmmd.js               # CLI logic
|-- lib/
|   |-- customMarkup.js          # Custom markup manager
|   |-- markdownToHtml.js        # Markdown to HTML conversion
|   |-- remarkMark.js            # <mark> syntax plugin
|   |-- remarkDfn.js             # <dfn> syntax plugin
|   |-- remarkStrikethrough.js   # <s> syntax plugin
|   |-- wrapHtml.js              # HTML wrapping logic

Internal Modules

  • markdownToHtml.js: Handles Markdown-to-HTML conversion.
  • wrapHtml.js: Wraps HTML output in a complete HTML document.

Adding New Syntax

  1. Create a new plugin file in lib/.
  2. Register it in customMarkup.js.
  3. Enable it in the customMarkup function call in markdownToHtml.js.

Contributions welcome! Follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature:
    git checkout -b feature-name
  3. Commit your changes:
    git commit -m "Add feature"
  4. Push to your branch:
    git push origin feature-name
  5. Open a pull request.

This project is licensed under the MIT License. See the LICENSE file for more details.


Enjoy! -SL