MCPcopy Index your code
hub / github.com/developit/snarkdown

github.com/developit/snarkdown @2.0.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 2.0.0 ↗ · + Follow
6 symbols 12 edges 3 files 2 documented · 33% 11 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Snarkdown

Snarkdown npm

Snarkdown is a dead simple 1kb Markdown parser.

It's designed to be as minimal as possible, for constrained use-cases where a full Markdown parser would be inappropriate.

Features

  • Fast: since it's basically one regex and a huge if statement
  • Tiny: it's 1kb of gzipped ES3
  • Simple: pass a Markdown string, get back an HTML string

Note: Tables are not yet supported. If you love impossible to read regular expressions, submit a PR!

Note on XSS: Snarkdown doesn't sanitize HTML, since its primary target usage doesn't require it.

Demos & Examples

Usage

Snarkdown exports a single function, which parses a string of Markdown and returns a String of HTML. Couldn't be simpler.

The snarkdown module is available in every module format you'd ever need: ES Modules, CommonJS, UMD...

import snarkdown from 'snarkdown';

let md = '_this_ is **easy** to `use`.';
let html = snarkdown(md);
console.log(html);
// <em>this</em> is <strong>easy</strong> to <code>use</code>.

Add-ons and Libraries

Extension points exported contracts — how you extend this code

Links (Interface)
(no doc)
snarkdown.d.ts

Core symbols most depended-on inside this repo

encodeAttr
called by 5
src/index.js
outdent
called by 2
src/index.js
tag
called by 2
src/index.js
flush
called by 2
src/index.js
parse
called by 0
src/index.js

Shape

Function 5
Interface 1

Languages

TypeScript100%

Modules by API surface

src/index.js5 symbols
snarkdown.d.ts1 symbols

For agents

$ claude mcp add snarkdown \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact