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

@moonwave99/goffre

v0.0.6

Published

Mini static site generator

Readme

Goffre

Goffre is a minimal static site generator available to the node.js ecosystem.

It uses handlebars as templating system and markdown + frontmatter as data layer, or whatever you decide to pass to render().

Installation

$ npm install goffre --save

Basic Usage

import { load, render } from "goffre";

(async () => {
    const { pages } = await load();

    try {
        const results = await render({ pages });
        console.log(`Generated ${results.length} pages`);
    } catch (error) {
        console.log("Error generating site", error);
    }
})();

Default paths:

  • markdown files: ./data - used by load()
  • output folder: ./dist - used by render()
  • handlebars views: ./src/views - used by render()

See examples for a more advanced use case, and the documentation for the complete reference.

Data collecting and rendering are separate steps

This is the key for the maximum flexibility: load() gets all the .md files inside the data folder, and populates its return pages each with a unique slug.

The markdown body is available in the content key, and the YAML front matter is destructured - the output of load() of the following file:

---
title: "Goffre | Mini static site generator"
slug: "index"
---
Goffre is a minimal static site generator available to the **node.js** ecosystem.

will be:

{
    title: "Goffre | Mini static site generator",
    slug: "index",
    content: "Goffre is a minimal static site generator available to the **node.js** ecosystem."
}

Note: the markdown body is not yet parsed at this stage.

The render() method writes then every incoming page to {page.slug}.html - you can add further pages to the collected ones, like the text you are reading from the main README.md file of the repository:

const { pages } = await load({ dataPath });
const results = await render({
    buildPath,
    sitePath,
    pages: [
        ...pages,
        {
            title: "Goffre | Mini static site generator",
            description:
                "Goffre is a minimal static site generator available to the node.js ecosystem.",
            slug: "index",
            content: await readFile(path.join("..", "README.md"), "utf8"),
        },
    ],
});

For a better development experience

Goffre does not provide any watching / serving features out of the box, but don't worry.

Serving: if you use webpack for bundling the frontend CSS and JS, just use its dev server - see the configuration file for this very page as reference. If you don't, a simple http-server will do.

Watching: use nodemon to watch the generation script, the data folder and the handlebars views folder:

$ nodemon -e js,json,md,handlebars --watch index.js --watch data --watch src/views

The scripts of package.json will look more or less like:

{
    "clean": "rm -rf dist",
    "dev:client": "webpack serve --mode development",
    "dev:site": "nodemon -e js,json,md,handlebars --watch index.js --watch data --watch src/views",
    "build:client": "webpack --mode production",
    "build:site": "node index.js"
}

Just npm run dev:client and npm run dev:site in two terminal tabs and you are done. Don't forget to npm install the needed dependencies of course!

Examples

  • devblog - a personal website with blog posts and project pages
  • this page of course