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

@nera-static/plugin-stacks

v2.1.0

Published

A plugin for Nera static site generator to create reusable content stacks with template-based rendering. Perfect for content components, widgets, and modular design systems.

Readme

@nera-static/plugin-stacks

A plugin for the Nera static site generator that allows you to define reusable content blocks (called "stacks") in Markdown. These blocks can be embedded into any page or layout — and optionally rendered using a custom template.

✨ Features

  • Define reusable Markdown content anywhere in the pages/ directory
  • Access stack data globally in your views via app.stacks
  • Use optional templates (.pug) to customize rendering per stack
  • Includes a publishable default template to get started quickly
  • Supports all frontmatter meta fields inside templates
  • BEM CSS methodology for consistent styling

🚀 Installation

Install the plugin in your Nera project:

npm install @nera-static/plugin-stacks

Nera will automatically detect the plugin, no additional setup or imports are required.

Usage

After installation, stacks can be used in all templates via app.stacks:

// In any template
div
    // Basic stack without layout
    != app.stacks.basic_stack.content

    // Stack with custom template
    != app.stacks.template_stack.content

JavaScript/Template Access:

// Access a stack
const stack = app.stacks.my_stack
console.log(stack.content) // Rendered HTML
console.log(stack.meta) // Original metadata

All frontmatter fields (like description) are accessible via app.stacks.<slug>.meta.

🧩 Stack Templates (Optional)

You can render stacks using a custom Pug template:

---
title: Using a stack template
description: A custom description
type: stack
slug: stack_with_template
stack_layout: views/stacks/stack-layout.pug
---

### Reuse me

This content will be rendered using the provided layout.

Example template (views/stacks/stack-layout.pug):

section.stack-wrapper
    header.stack-header
        h2 #{ stack.meta.title }
        p #{ stack.meta.description }
    article.stack-article
        | !{ stack.content }

The usage in your views stays the same:

main
    | !{ app.stacks.stack_with_template.content }

🛠️ Publish Default Template

Use the default template provided by the plugin:

npx @nera-static/plugin-stacks run publish-template

This copies the template to:

views/vendor/plugin-stacks/stack-template.pug

You can then use it in your stack frontmatter like so:

stack_layout: views/vendor/plugin-stacks/stack-template.pug

🧪 Development

npm install
npm test
npm run lint

Tests are powered by Vitest and cover:

  • Loading and rendering of stack data
  • Template rendering support
  • Template publishing logic and file overwrite prevention

🔄 Compatibility

  • Nera v4.1.0+: Full compatibility with latest static site generator
  • Node.js 18+: Modern JavaScript features and ES modules
  • Plugin Utils v1.1.0+: Enhanced plugin utilities integration

🏗️ Architecture

This plugin uses the getAppData() function to process page data and make stacks available via app.stacks. Stacks are identified by their slug and can be rendered using custom templates.

🎨 BEM CSS Classes

The default template uses BEM (Block Element Modifier) methodology:

  • .stack - Main stack container
  • .stack__header - Stack header section
  • .stack__title - Stack title element
  • .stack__description - Stack description element
  • .stack__content - Stack content area

🧑‍💻 Author

Michael Becker
https://github.com/seebaermichi

🔗 Links

📄 License

MIT