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

@greenwood/plugin-markdown

v0.34.0

Published

A Greenwood plugin for processing markdown files for pages using the Unified ecosystem.

Readme

@greenwood/plugin-markdown

Overview

A Greenwood plugin for processing markdown files for pages using the Unified ecosystem, which includes remark and rehype based plugins. For more information and complete docs, please visit the docs page.

This package assumes you already have @greenwood/cli installed.

Installation

You can use your favorite JavaScript package manager to install this package.

# npm
$ npm i -D @greenwood/plugin-markdown

# yarn
$ yarn add @greenwood/plugin-markdown --dev

# pnpm
$ pnpm add -D @greenwood/plugin-markdown

Usage

Use this plugin in your greenwood.config.js:

import { greenwoodPluginMarkdown } from '@greenwood/plugin-markdown';

export default {
  // ...

  plugins: [
    greenwoodPluginMarkdown()
  ]
}

Now you can start authoring content in markdown!

src/
  pages/
    index.html
    about.md

Types

Types should automatically be inferred through this package's exports map, but can be referenced explicitly in both JavaScript (JSDoc) and TypeScript files if needed.

/** @type {import('@greenwood/plugin-markdown').MarkdownPlugin} */
import type { MarkdownPlugin } from '@greenwood/plugin-markdown';

Options

Plugins

You can install remark or rehype compatible plugins to extend this plugin's markdown rendering and transformation capabilities by passing their names in as an array.

For example, after installing something like rehype-slug pass the name as a string when adding the plugin to your Greenwood config file:

import { greenwoodPluginMarkdown } from '@greenwood/plugin-markdown';

export default {
  plugins: [
    greenwoodPluginMarkdown({
      plugins: [
        "rehype-slug"
      ],
    })
  ]
}

If you need to pass options to a markdown plugin, you can use object syntax with the plugin name and the options it takes.

import { greenwoodPluginMarkdown } from '@greenwood/plugin-markdown';

export default {
  plugins: [
    greenwoodPluginMarkdown({
      plugins: [
        "rehype-slug",
        {
          name: "rehype-autolink-headings",
          options: {
            behavior: "append"
          },
        },
      ],
    })
  ]
}

Standalone Usage

For cases where you may want to manually process markdown not in your pages directory, but leverage all the logic Greenwood uses to process markdown, you can programmatically call the exported function processMarkdown, which has two parameters:

  • contents - Your markdown as a string
  • plugins - The same plugins you would pass in as options to the markdown plugin

This function will return the processed markdown as an HTML string.

Here is a basic example:

import fs from "node:fs/promises";
import { processMarkdown } from "@greenwood/plugin-markdown";

const contents = await fs.readFile(new URL('./path/to/your/markdown/file.md', import.meta.url), 'utf-8');
const plugins = [
  "@mapbox/rehype-prism",
  {
    name: "rehype-autolink-headings",
    options: { behavior: "append" },
  },
];

const html = await processMarkdown(contents, plugins);

console.log({ html });