natemoo-re / goldmark

Home Page:https://deno.land/x/goldmark

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Goldmark

A very fast Markdown compiler for Deno 🦕

Powered by Go's Goldmark compiled to WASM.

Usage

Basic Example

import { init, transform } from "https://deno.land/x/goldmark/mod.ts";

await init();
const markdown = await Deno.readTextFile(new URL('./content.md', import.meta.url));
const { frontmatter, content } = await transform(markdown, {
    render: {
        unsafeHTML: true
    },
    extensions: {
        GFM: true,
        typographer: true,
    }
})

console.log(frontmatter);
console.log(content);

Configuration

Goldmark comes with many built-in extensions. See the types.ts file for complete options.

Performance

Runs come in well under 1ms on average. See bench/mod.ts.

Sampling 100,000 runs completed in 58s with an average run of 0.57ms.

About

https://deno.land/x/goldmark


Languages

Language:JavaScript 99.5%Language:TypeScript 0.3%Language:Go 0.2%Language:Makefile 0.0%