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

lil-marky

v1.0.2

Published

A lightweight, fast Markdown parser for JavaScript that converts Markdown text into an Abstract Syntax Tree (AST) with built-in HTML and plain text renderers.

Downloads

85

Readme

lil-marky

A lightweight, fast Markdown parser for JavaScript that converts Markdown text into an Abstract Syntax Tree (AST) with built-in HTML and plain text renderers.

🎯 Features

  • 🪶 Lightweight: Minimal dependencies, focused on core Markdown parsing
  • Fast: Two-stage parsing (block → inline) for optimal performance
  • 🔧 Extensible: Schema-driven architecture allows custom element definitions
  • 🎨 Flexible Rendering: Built-in HTML and plain text renderers with customization options
  • 📦 Dual Module Support: Works with both CommonJS and ES modules
  • Comprehensive: Supports all standard Markdown elements plus common extensions

📥 Installation

npm install lil-marky

🚀 Quick Start

const marky = require('lil-marky');

// Create a parser instance
const md = marky.create();

// Parse to AST
const ast = md.parse('# Hello *world*!');

// Parse and render to HTML
const html = md.parse('# Hello *world*!', marky.html());
// Output: <h1>Hello <em>world</em>!</h1>

// Parse and render to plain text
const text = md.parse('# Hello *world*!', marky.plain());
// Output: Hello world!

🎪 ES Module Usage

import marky from './esm/lil-marky.js';

const md = marky.create();
const result = md.parse('**Bold text**', marky.html());

📝 Supported Markdown Elements

📰 Headings

Supports ATX-style (# H1 through ###### H6) and Setext-style headings:

# Heading 1
## Heading 2
### Heading 3

Alt Heading 1
=============

Alt Heading 2
-------------

💪 Emphasis

Multiple emphasis styles for text formatting:

*italic* or _italic_
**bold** or __bold__
***bold italic***
~~strikethrough~~

📋 Lists

Unordered and ordered lists with full nesting support:

- Item 1
- Item 2
  - Nested item
  - Another nested item

1. First item
2. Second item
3. Third item

🔗 Links

Multiple link formats including auto-linking:

[Link text](https://example.com)
[Link with title](https://example.com "Title")
<https://example.com>
<[email protected]>
[Email with text](mailto:[email protected]?subject=Hello)

Auto-linking can be enabled with marky.create({ autoLink: true }).

🖼️ Images

Standard markdown image syntax:

![Alt text](image.jpg)
![Alt text](image.jpg "Image title")

💻 Code

Inline code and fenced code blocks with optional syntax highlighting:

Inline `code` in text

```javascript
// Fenced code block
const x = 42;

### 💬 Blockquotes
Blockquotes with nesting support:

```markdown
> Single quote
>
> Multiple paragraphs

> Outer quote
>> Nested quote

➖ Horizontal Rules

Create horizontal rules with:

---
___

↩️ Line Breaks

Manual line breaks and paragraph separation:

Line 1
Line 2 (two spaces at end of line 1)

Paragraph 1

Paragraph 2 (blank line separates paragraphs)

🎨 Custom Renderers

You can create custom renderers that receive the AST:

function customRenderer(nodes) {
  // Process AST nodes and return custom output
  return processNodes(nodes);
}

const result = md.parse(text, customRenderer);

🌳 AST Structure

The parser generates a hierarchical AST with nodes containing:

  • type: Element type (heading, paragraph, bold, etc.)
  • props: Element properties (level, url, etc.)
  • children: Child nodes for container elements
// Example AST for "# Hello *world*!"
[{
  type: 'heading',
  props: { level: 1 },
  children: [
    { type: 'text', props: { value: 'Hello ' } },
    { 
      type: 'italic',
      children: [{ type: 'text', props: { value: 'world' } }]
    },
    { type: 'text', props: { value: '!' } }
  ]
}]