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

folderblog

v0.0.2

Published

Official SDK for folder.blog — client, server middleware, and markdown processing

Downloads

151

Readme

folderblog

Official SDK for folder.blog — API client, server middleware, markdown processor, and CLI in one package.

Install

npm i folderblog

API Client

Read posts from any folder.blog site:

import { folderBlog } from "folderblog";

const blog = folderBlog("yourname.folder.blog");

const posts = await blog.posts.list();
const post = await blog.posts.get("hello-world");
const site = await blog.site.get();
const tags = await blog.tags.list();
const rss = await blog.feed.rss();

Markdown Processor

Process a folder of markdown files into structured JSON:

import { processFolder } from "folderblog";

const result = await processFolder({
  dir: { input: "./content", output: "./dist" },
});

console.log(`${result.posts.length} posts processed`);

Enable wiki-link resolution (Obsidian-style [[links]]):

const result = await processFolder({
  dir: { input: "./vault", output: "./dist" },
  pipeline: { wikiLinks: true },
});

Using the Processor class directly

import { Processor } from "folderblog";

const processor = new Processor({
  config: {
    dir: { input: "./content", output: "./dist" },
    pipeline: { gfm: true, allowRawHtml: true },
  },
});

await processor.initialize();
const result = await processor.process();
await processor.dispose();

Markdown utilities

import { processMarkdown, parseFrontmatter, toSlug } from "folderblog";

const { html, frontmatter } = await processMarkdown("# Hello\n\nWorld");
const slug = toSlug("My Blog Post"); // 'my-blog-post'

Server Middleware

Proxy a folder.blog into your app. Works with any Web Standard Request/Response framework:

import { createHandler } from "folderblog/server";

const handler = createHandler({
  domain: "yourname.folder.blog",
  basePath: "/blog",
});

// Hono
app.get("/blog/*", (c) => handler(c.req.raw));

// Node.js / any Web Standard server
const response = await handler(request);

CLI

npx folderblog build                    # Auto-detect config
npx folderblog build -i ./content       # Specify input dir
npx folderblog build -o ./dist          # Specify output dir
npx folderblog build -c my.config.js    # Custom config file

Config file (auto-detected as folderblog.config.{js,mjs,ts}):

export default {
  dir: { input: "./content", output: "./dist" },
  pipeline: { gfm: true, wikiLinks: true },
};

Sub-path Imports

For tree-shaking, import from specific sub-paths:

import { Processor } from "folderblog/processor";
import { PluginManager } from "folderblog/processor/plugins";
import type { ProcessConfig, ProcessedPost } from "folderblog/processor/types";
import { createHandler } from "folderblog/server";
import { build } from "folderblog/cli";

Everything is also available from the main 'folderblog' entry point.

Error Handling

import { folderBlog, NotFoundError, ApiError, NetworkError } from "folderblog";

const blog = folderBlog("yourname.folder.blog");

try {
  const post = await blog.posts.get("missing");
} catch (err) {
  if (err instanceof NotFoundError) {
    console.log("Post not found");
  } else if (err instanceof ApiError) {
    console.log(`API error: ${err.status}`);
  } else if (err instanceof NetworkError) {
    console.log("Network failure", err.cause);
  }
}

License

MIT