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

marquisjs

v1.0.1

Published

Markdown to HTML Engine

Readme

Marquis

npm

Marquis is a fast, regex-based Markdown to HTML conversion engine. It is both lightweight and offers additional features such as basic input sanitization. Recognizes all basic markdown syntax with extended syntax in development.

Visit the Demo to see what Marquis can do...

Performance Benchmarks

Testing was done using various files both with and without Markdown syntax being utilized. Each file was tested 15 times on each implementation with the 5 fastest being used to calculate the average which is shown in the results below.

Markdown Documentation - Syntax.text | Implementation | Time | | ------ | ------ | | Marquis 🥇 | 3.35 ms | | markdown-it | 10.40 ms | | Marked | 14.07 ms | | Showdown | 18.37 ms |


The Canterbury Corpus - Alice29.txt | Implementation | Time | | ------ | ------ | | Marquis 🥇 | 8.06 ms | | markdown-it | 17.92 ms | | Marked | 18.68 ms | | Showdown | 47.16 ms |


The Large Corpus - bible | Implementation | Time | | ------ | ------ | | markdown-it | 79.78 ms | | Marked | 88.69 ms | | Marquis 🥉 | 150.25 ms | | Showdown | 258.83 ms |

Installation

$ npm i marquisjs

Usage

Importing

import { marquis } from 'marquisjs'

Converting

const markdownText = `# Header 1`
const formattedBody = await marquis(markdownText);

Output

> console.log(formattedBody)

<pre class="marquis__body" style="white-space:pre-wrap;">
<h1>Header 1</h1>
</pre>

Styling

The HTML generated is wrapped in a <pre> tag with class marquis__body. It also by default styled with white-space: pre-wrap. By default <pre> will typically use monospace font. To change this along with any other styles simply add to your stylesheet.

Example:

.marquis__body {
    font-family: "Inter"
}

Notes

When using Marquis, there are a few things to note.

Wrapping with <pre>

The decision to wrap the generated HTML in a <pre> tag came from a desire to have the output match the desired intention of the input. In other markdown implementations <p> tags are utilized to contain lines of text seperated by 2 or more linebreaks. If a user wants 3 linebreaks in a row they have to resort to hacky methods to accomplish this. I think Markdown can be such a valuable tool for so many applications, so removing any barrier to entrance was a priority. Wrapping the generated HTML in a <pre> tag is unorthodox, but I found for the everyday user this will better reflect their intentions.

Lists

Lists in Marquis are stricter than other implementations. The regex used to match a list is:

/(?<=^ +(\d\.|\*|\+|-) +.*$(\n+)|)^( +)(\d\.|\*|\+|-)( +.*)$(\n*)(?=( +)(\d\.|\*|\+|-) |)/gm

This regex is capable of detecting both ordered and unordered lists as well as depth. Marquis requires at least one space before the list marker (*, +, -, n. ). The motivation behind this is that a user should be deliberate in starting a list. In other markdown implementations a list will be detected if an asterisk is simply the first character in a line. I find this approach to be flawed as it concerns intentionality. If one wanted to put an asterisk at the start of a newline, they would have to escape it with a backslash in most implementations. I believe utilizing Markdown syntax should be the deliberate act, not the inputting of plain text. By requiring a space before the marker, the act of intentionality is rightfully passed from the inputting of plaintext to the Markdown syntax.

The next point of interest is how Marquis handles nested lists. Orders of depth are defined by 4 spaces. This means you can have arbitrary levels of depth without requiring all the previous levels of depth. Example:

 * 1_1
         * 3_1
     * 2_1
         * 3_2
 * 1_2

Version History

Marquis 1.0.0

Features:

  • Recognition of the following markdown syntax:
    • Headings
      • '#' and '='/'-' underlining
    • Emphasis
      • Italic '*text*' and '_test_'
      • Bold '**text**' and '__text__'
    • Strikethrough
      • '~~text~~'
    • Code
      • Inline '`text`'
      • Block '```text```'
    • Lists
      • Ordered ' n. text'
      • Unordered ' * text' | ' - text' | ' + text'
    • Links
      • '[link text](url)
    • Images
      • '![alt text](url)
    • Horizontal Rules
      • '---' and '___'
    • Escaped Characters
      • '\character'
  • Basic Input sanitization

Missing Features:

  • Does not recognize the following markdown syntax:
    • Tables
    • Footnotes
    • Definition Lists
    • Task Lists
    • Emoji
    • Highlight
    • Subscript
    • Superscript