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

staticblocks

v0.2.0

Published

A simple, block-based static site generator

Readme

StaticBlocks

A simple, block-based static site generator built with TypeScript.

Note: StaticBlocks is currently in early development (v0.1.0). While fully functional, some advanced features are still being developed. Contributions and feedback are welcome!

Why StaticBlocks?

Modern web development often involves heavy JavaScript frameworks for simple static websites. StaticBlocks brings back the simplicity of static HTML while providing a modern, block-based development experience.

Key Features:

  • 📦 Block-based architecture
  • 🌍 Built-in i18n support
  • 🎨 Tailwind CSS or Bootstrap
  • 🚀 Fast builds
  • 🔍 SEO-optimized output
  • 💻 TypeScript-based
  • 🎯 Zero JavaScript runtime required

Installation

npm install -g staticblocks

Quick Start

# Create a new project
staticblocks init my-website

# Navigate to project
cd my-website

# Install dependencies (yarn or npm)
yarn install
# or
npm install

# Start development server
yarn run dev
# or
npm run dev

# Build for production
yarn run build
# or
npm run build

Project Structure

my-website/
├── src/
│   ├── templates/          # HTML templates
│   │   └── main.html
│   ├── blocks/             # Reusable blocks
│   │   ├── nav.html
│   │   └── hero.html
│   ├── pages/              # Page configurations (YAML)
│   │   └── index.yaml
│   ├── locales/            # Translation files (JSON)
│   │   ├── de.json
│   │   └── en.json
│   └── assets/
│       ├── css/
│       ├── js/
│       └── images/
├── dist/                   # Build output
├── staticblocks.config.ts  # Project configuration
└── package.json

CLI Commands

Create New Project

staticblocks init <project-name>

Generate Components

# Generate a new block
staticblocks generate block hero --with-js --with-css

# Generate a new template
staticblocks generate template blog

# Generate a new page
staticblocks generate page about

Development

# Start dev server with hot reload
staticblocks dev

# Start dev server on specific port
staticblocks dev --port 8080

# Build for production
staticblocks build

# Build with verbose output
staticblocks build --verbose

Add Resources

# Add a new locale
staticblocks add locale fr

# Add a new script
staticblocks add script analytics

Validation

# Validate all project files
staticblocks validate

# Validate specific types
staticblocks validate locales
staticblocks validate pages
staticblocks validate templates
staticblocks validate blocks

Template Syntax

Variables

{{variableName}}
{{page.title}}
{{page.meta.description}}

Conditionals

{{#if condition}}
  <p>Content when true</p>
{{/if}}

Loops

{{#each items}}
  <div>{{name}}</div>
{{/each}}

Special Helpers

Translation:

{{translate:nav.home}}
{{translate:buttons.submit}}

Active Navigation:

<a href="/about/" class="{{active:/about/}}">About</a>

Language Prefix:

<a href="{{langPrefix}}/contact/">Contact</a>

Current Language:

<html lang="{{currentLang}}">

Page Configuration (YAML)

template: main
title: About Us
lang: de
activeNav: about
meta:
  description: Learn more about our company
  keywords:
    - company
    - about
blocks:
  - block: nav
  - block: hero
    title: About Our Company
    description: We build amazing things
    image: /assets/images/about.jpg
  - block: features
    items:
      - title: Fast
        description: Lightning fast performance
      - title: Simple
        description: Easy to understand

Blocks

Blocks are reusable HTML components with props:

blocks/card.html:

<div class="card">
  <img src="{{image}}" alt="{{title}}">
  <h3>{{title}}</h3>
  <p>{{description}}</p>
  {{#if link}}
    <a href="{{link}}">Learn more</a>
  {{/if}}
</div>

Usage in page:

blocks:
  - block: card
    image: /assets/images/product.jpg
    title: Our Product
    description: The best product ever
    link: /products/

JavaScript in Blocks

Option 1: Inline

<div class="slider" data-component="slider">
  <!-- HTML -->
</div>

<script>
  document.querySelectorAll('[data-component="slider"]').forEach(slider => {
    // Init code
  });
</script>

Option 2: Separate File

blocks/slider.html:

<div class="slider" data-component="slider">
  <!-- HTML -->
</div>

blocks/slider.js:

export function initSlider() {
  document.querySelectorAll('[data-component="slider"]').forEach(slider => {
    // Init code
  });
}

Internationalization (i18n)

locales/de.json:

{
  "nav": {
    "home": "Startseite",
    "about": "Über uns"
  }
}

locales/en.json:

{
  "nav": {
    "home": "Home",
    "about": "About"
  }
}

Usage:

<a href="/">{{translate:nav.home}}</a>

Build Output:

dist/
├── index.html              # Default locale (de)
├── about/
│   └── index.html
├── en/
│   ├── index.html          # English version
│   └── about/
│       └── index.html
└── assets/

Configuration

staticblocks.config.ts:

import { ProjectConfig } from 'staticblocks/types';

export default {
  css: 'tailwind',
  icons: 'lucide',
  i18n: {
    defaultLocale: 'de',
    locales: ['de', 'en', 'fr'],
    strategy: 'prefix_except_default'
  },
  scripts: {
    global: ['assets/js/main.js'],
    external: [
      'https://cdn.example.com/script.js'
    ]
  },
  port: 3000
} as ProjectConfig;

Development Roadmap

  • [x] Phase 1: Project Setup & CLI
  • [x] Phase 2: Template Engine
  • [x] Phase 3: Build System
  • [x] Phase 4: i18n Support
  • [x] Phase 5: JavaScript Integration
  • [x] Phase 6: Asset Pipeline
  • [x] Phase 7: SEO & Meta
  • [x] Phase 8: Validation
  • [x] Phase 9: Dev Server
  • [ ] Phase 10: Advanced Features (Plugins, CMS Integration, etc.)

Publishing Your Site

After building your project with staticblocks build, the dist/ folder contains your complete static website. You can deploy it to any static hosting service:

  • Netlify: Drop the dist folder or connect your Git repository
  • Vercel: Import your project and set build command to npm run build
  • GitHub Pages: Push the dist folder to your gh-pages branch
  • Any static hosting: Upload the dist folder contents

Requirements

  • Node.js >= 16.0.0
  • npm or yarn

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

License

MIT - see LICENSE file for details


Built with ❤️ for the modern web