@tinyhttp/markdown

npm GitHub Workflow Status Coverage

Static markdown middleware for Node.js.

Install

pnpm i @tinyhttp/markdown

API

markdownStaticHandler(dir, options)

Handles static files and transforms markdown in HTML in a specified directory. It tries to assign root to README.md or index.md (and with .markdown extension too) in case any of them exists.

Options

Example

import { App } from '@tinyhttp/app'
import { markdownStaticHandler as md } from '@tinyhttp/markdown'

new App()
  .use(
    md('docs', {
      prefix: '/docs',
      stripExtension: true,
      markedExtensions: [{ headerIds: true }]
    })
  )
  .listen(3000)

Install

pnpm i @tinyhttp/markdown

Version

1.3.4

Source

@tinyhttp/markdown