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

express-markdown-router

v1.1.0

Published

Express middleware for generating pages dynamically using markdown files

Readme

express-markdown-router

Express middleware for generating pages dynamically using markdown files. Say goodbye to explicitly bootstrapping routes in your Express app!

Installation

npm install express-markdown-router

Quick Start

You must be using an Express template engine to use this middleware

var express = require('express');
var markdownRouter = require('express-markdown-router');

var app = express();

app.set('port', process.env.PORT || 3000);

// Using the jade template engine
app.set('view engine', 'jade');

// Use the markdownRouter middleware and pass the directory of your .md files
app.use(markdownRouter(__dirname + '/pages'));

app.listen(app.get('port'), function() {
    console.log('Server started on port %d', app.get('port'));
});

This will start a server and build an index of routes based on the .md files found in the ./pages dir

It will then send the local var markdown from the parsed markdown file inside the index[.ext] view.

Routing

Currently there is one special route: index.md will map to the root path '/'

All other routes will map page.md to /page and page.subpage.md to /page/subpage and so on...

Additional Params

The view used to render the markdown files within will default to index[.ext]. You can change this by passing a second param to the middleware:

// Uses a view called 'markdown'
app.use(markdownRouter(__dirname + '/pages', 'markdown'));

Caching

All routes are cached on server start, but in development, the contents of the .md files will not be so you can freely update your pages on the fly before deploying them.