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

@guren/plugin-markdown

v0.3.0

Published

Markdown-to-HTML rendering for [Guren](https://guren.dev/) applications: GitHub Flavored Markdown, sanitized output by default, GitHub-style alerts, heading anchors, and optional shiki code highlighting (RFC 0012).

Readme

@guren/plugin-markdown

Markdown-to-HTML rendering for Guren applications: GitHub Flavored Markdown, sanitized output by default, GitHub-style alerts, heading anchors, and optional shiki code highlighting (RFC 0012).

bunx guren plugin @guren/plugin-markdown
bun add @guren/plugin-markdown

Rendering

import { createMarkdownRenderer } from '@guren/plugin-markdown'

const renderer = createMarkdownRenderer()
const html = await renderer.render('# Hello\n\n> [!NOTE]\n> Sanitized by default.')

render() is a pure async function — render at save time and store the HTML, or render per request; the package has no cache and no opinion.

Defaults (all overridable):

  • sanitize: true — output passes a sanitize-html allowlist tuned for markdown plus shiki's inline styles: javascript:/data:/protocol-relative URLs are dropped, raw HTML is escaped, only shiki-shaped style declarations survive. The rendered HTML is safe to inject with dangerouslySetInnerHTML. Pass false for trusted content, or a callback to extend the allowlist:

    createMarkdownRenderer({
      sanitize: (defaults) => ({
        ...defaults,
        allowedTags: [...(defaults.allowedTags as string[]), 'video'],
      }),
    })
  • alerts: true> [!NOTE] / [!TIP] / [!IMPORTANT] / [!WARNING] / [!CAUTION] blockquotes become labeled alert blocks with guren-markdown-alert class names.

  • anchors: true — headings get slug ids (unicode-aware, duplicate-safe, hardened against HTML smuggled into heading text).

  • rewriteLink — hook over every link href, e.g. rewriting relative .md links to routes.

  • highlight — code-fence highlighter, (code, lang) => string | Promise<string>.

Shiki highlighting

shiki is an optional peer dependency behind its own subpath — install it only if you use it:

bun add shiki
import { createMarkdownRenderer } from '@guren/plugin-markdown'
import { createShikiHighlight } from '@guren/plugin-markdown/shiki'

const renderer = createMarkdownRenderer({
  highlight: createShikiHighlight({
    themes: { light: 'rose-pine-dawn', dark: 'rose-pine-moon' },
    langs: ['typescript', 'tsx', 'bash', 'json'],
  }),
})

This builds a fine-grained shiki/core highlighter (only the listed grammars, JavaScript regex engine — no oniguruma WASM) and emits dual-theme output: the light palette inline, the dark palette in --shiki-dark custom properties. Fences in unloaded languages fall back to plain text.

Bundlers that must see every import statically (Cloudflare Workers builds) should pass explicit modules instead of names:

createShikiHighlight({
  themes: { light: 'rose-pine-dawn', dark: 'rose-pine-moon' },
  themeModules: [
    import('shiki/dist/themes/rose-pine-dawn.mjs'),
    import('shiki/dist/themes/rose-pine-moon.mjs'),
  ],
  langModules: [import('shiki/dist/langs/typescript.mjs')],
})

Styling

The renderer emits class names but no styles. A small reference stylesheet covers alerts and the dark-mode shiki toggle:

import '@guren/plugin-markdown/styles.css'

As a plugin

import { markdownPlugin } from '@guren/plugin-markdown'

createApp({
  providers: [markdownPlugin({ /* renderer options */ })],
})

The provider binds the configured renderer as the markdown container service:

import type { MarkdownRenderer } from '@guren/plugin-markdown'

const renderer = container.make<MarkdownRenderer>('markdown')