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

eleventy-plugin-mdlite

v0.3.1

Published

Eleventy plugin that copies raw markdown to output and generates a SQLite index

Readme

eleventy-plugin-mdlite

Eleventy plugin that copies raw markdown files to your output directory and generates a SQLite index of all pages.

Features

  • Raw markdown output — copies your .md source files alongside the rendered HTML so they're accessible at clean URLs (e.g. /docs/foo.md)
  • Frontmatter stripping — YAML frontmatter is automatically removed from output files and database content
  • Template processing — Nunjucks variables, filters, and includes are expanded in the output; unpaired shortcodes are executed; paired shortcodes are passed through as-is
  • Custom header injection — optionally prepend a header (e.g. a comment or license notice) to each output markdown file
  • SQLite index — generates a sqlite.db with FTS5 full-text search containing every page's URL, title, and content

Installation

npm install eleventy-plugin-mdlite

Usage

In your Eleventy config file (e.g. eleventy.config.js):

import mdlitePlugin from "eleventy-plugin-mdlite";

export default function (eleventyConfig) {
  eleventyConfig.addPlugin(mdlitePlugin);
}

Options

| Option | Default | Description | | ------------ | ------------- | ---------------------------------------------------------------------------- | | dbFilename | "sqlite.db" | Name of the SQLite database file written to the output directory | | pathPrefix | "/" | Only index pages whose URL starts with this prefix; database is placed there | | header | "" | String prepended to each output markdown file (e.g. a comment or notice) |

eleventyConfig.addPlugin(mdlitePlugin, {
  dbFilename: "index.db",
  pathPrefix: "/docs",
  header: "<!-- This file was generated automatically. Do not edit. -->",
});

SQLite Schema

The generated database contains a pages table and a pages_fts FTS5 virtual table for full-text search:

| Column | Type | Description | | --------- | ------------------ | -------------------------------------- | | path | TEXT PRIMARY KEY | Page URL (e.g. /docs/foo/) | | title | TEXT | Title from frontmatter | | content | TEXT NOT NULL | Markdown source (frontmatter stripped) |

Example Queries

Open the generated database with the sqlite3 CLI or any SQLite client:

sqlite3 _site/sqlite.db

Full-text search — find pages matching a term (results ranked by relevance):

SELECT p.path, p.title, f.rank
FROM pages_fts f
JOIN pages p ON p.rowid = f.rowid
WHERE pages_fts MATCH 'deploy'
ORDER BY f.rank;

Phrase search — match an exact phrase:

SELECT p.path, p.title
FROM pages_fts f
JOIN pages p ON p.rowid = f.rowid
WHERE pages_fts MATCH '"getting started"';

Boolean operators — combine terms with AND, OR, NOT:

SELECT p.path, p.title
FROM pages_fts f
JOIN pages p ON p.rowid = f.rowid
WHERE pages_fts MATCH 'api AND authentication NOT deprecated';

Search within a specific column — restrict matches to titles only:

SELECT p.path, p.title
FROM pages_fts f
JOIN pages p ON p.rowid = f.rowid
WHERE pages_fts MATCH 'title:setup';

Snippet extraction — return a highlighted excerpt around the matching term:

SELECT p.path, snippet(pages_fts, 1, '<b>', '</b>', '...', 20) AS excerpt
FROM pages_fts f
JOIN pages p ON p.rowid = f.rowid
WHERE pages_fts MATCH 'install';

The FTS5 index uses the unicode61 tokenizer for Unicode-aware word segmentation and case-insensitive matching.

Limitations

This plugin has only been tested with Nunjucks, Eleventy's default template language. Other template engines (Liquid, Handlebars, etc.) may not work correctly.

Requirements

  • Eleventy 3.x (@11ty/eleventy ^3.0.0)
  • Node.js with ESM support