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

skriplet

v0.1.0

Published

Lightweight headless CMS powered by markdown files

Downloads

12

Readme

skriplet

Lightweight headless CMS powered by markdown files. Drop .md files into a folder, get structured data and a clean JSON API back. No database, no dashboard, no config.

Install

bun add skriplet
# npm install skriplet
# pnpm add skriplet
# yarn add skriplet

Requires Node.js 18+.

How It Works

Skriplet reads a content/ directory from your project root. Each subdirectory is a collection, each .md file inside it is an item, and the filename becomes the slug.

content/
  blog/
    hello-world.md      → slug: "hello-world"
    second-post.md      → slug: "second-post"
  docs/
    introduction.md     → slug: "introduction"

YAML frontmatter in each file becomes structured data:

---
title: Hello World
date: 2026-01-15
tags: [intro, welcome]
published: true
---

Your markdown content goes here.

API

getCollections(contentDir?)

List all collections with item counts.

import { getCollections } from 'skriplet'

const collections = await getCollections()
// [{ name: 'blog', count: 3 }, { name: 'docs', count: 2 }]

getCollection(name, contentDir?)

Get all items in a collection, sorted alphabetically by slug.

import { getCollection } from 'skriplet'

const collection = await getCollection('blog')
// {
//   name: 'blog',
//   count: 2,
//   items: [
//     {
//       slug: 'hello-world',
//       collection: 'blog',
//       data: { title: 'Hello World', date: '2026-01-15', published: true },
//       content: 'Your markdown content goes here.',
//       raw: '---\ntitle: Hello World\n...'
//     }
//   ]
// }

Returns null if the collection doesn't exist.


getItem(collection, slug, contentDir?)

Get a single item by collection name and slug.

import { getItem } from 'skriplet'

const item = await getItem('blog', 'hello-world')
// {
//   slug: 'hello-world',
//   collection: 'blog',
//   data: { title: 'Hello World', ... },
//   content: 'Your markdown content goes here.',
//   raw: '---\ntitle: Hello World\n...'
// }

Returns null if the item doesn't exist.


parseFrontmatter(raw)

Parse a raw markdown string with YAML frontmatter. Useful if you're reading files yourself.

import { parseFrontmatter } from 'skriplet'

const { data, content } = parseFrontmatter(`---
title: My Post
published: true
tags: [a, b]
---

Body content here.
`)

// data    → { title: 'My Post', published: true, tags: ['a', 'b'] }
// content → 'Body content here.'

Supports strings, numbers, booleans, null, and inline arrays. No external dependencies.

Custom Content Directory

All functions accept an optional contentDir path as the last argument:

import path from 'path'
import { getCollections } from 'skriplet'

const collections = await getCollections(path.join(process.cwd(), 'my-content'))

TypeScript

Full types are included — no @types package needed.

import type { ContentItem, Collection, CollectionMeta } from 'skriplet'

| Type | Description | |---|---| | CollectionMeta | { name: string, count: number } | | Collection | CollectionMeta & { items: ContentItem[] } | | ContentItem | { slug, collection, data, content, raw } |

Usage with Next.js

// app/blog/page.tsx (Server Component)
import { getCollection } from 'skriplet'

export default async function BlogPage() {
  const collection = await getCollection('blog')
  return (
    <ul>
      {collection?.items.map(post => (
        <li key={post.slug}>{post.data.title as string}</li>
      ))}
    </ul>
  )
}

Usage with Astro

---
import { getCollection } from 'skriplet'
const collection = await getCollection('blog')
---

{collection?.items.map(post => <h2>{post.data.title}</h2>)}

License

MIT