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

@leonardoavalerio/tiny-ssr

v1.0.18

Published

A minimalistic **Server-Side Rendering (SSR) framework** for Node.js, designed to dynamically render HTML pages using a component-like structure similar to front-end frameworks.

Readme

Tiny-SSR

A minimalistic Server-Side Rendering (SSR) framework for Node.js, designed to dynamically render HTML pages using a component-like structure similar to front-end frameworks.

This framework provides:

  • Widget system: Build reusable HTML elements programmatically.
  • Page abstraction: Define complete HTML pages with <head> and <body> content.
  • SSR server: Serve static assets and precompiled pages automatically.

Features

  • Component-based page construction with Widget and Page.
  • Automatic HTML string generation for server rendering.
  • Lightweight HTTP server to handle SSR and static files.
  • Supports dynamic routes and fallback 404 pages.

Installation

npm install @leonardoavalerio/tiny-ssr

Setup

After installing, you can run the following command to generate the default project configuration:

npx create-tiny-ssr

Usage

  1. Create a Page Import the Widget and Page classes, and define the page structure:
import { Widget } from '@leonardoavalerio/tiny-ssr/lib/structure-components/widget';
import { Page } from '@leonardoavalerio/tiny-ssr/lib/structure-components/page';

export default new Page({
  title: 'My First Page',
  children: [
    new Widget({
      element: 'div',
      class: ['container'],
      children: [
        new Widget({
          element: 'h1',
          children: ['Hello, World!']
        }),
        new Widget({
          element: 'p',
          children: ['This is a server-rendered page.']
        })
      ]
    })
  ]
});

  1. Start the SSR Server Import SSRServer and configure it:
import { SSRServer } from "@leonardoavalerio/tiny-ssr/lib/server/index";

const server = new SSRServer({
  port: 3000,
  pagesDir: './dist/src/app', // path to compiled pages
  publicDir: './public'   // path to static assets
});

server.init();
  • Serves static files from publicDir.
  • Renders precompiled pages from pagesDir.
  • Automatically falls back to a 404 page if a route is not found.

Api

Widget

Properties:

  • element: keyof HTMLElementTagNameMap – HTML tag name.
  • attributes?: Record<string, string> – Element attributes.
  • children?: WidgetContent[] – Nested content (string or Widget).
  • class?: string[] – CSS classes.
  • id?: string – Element ID.
  • style?: Partial<CSSStyleDeclaration> – Inline styles.

Methods:

  • build(): string – Returns the HTML string representation of the widget and its children.

Page

Properties:

  • title: string – Page title.
  • children: WidgetContent[] – Body content.
  • headers?: WidgetContent[] – Optional content.

Methods:

  • build(): string – Returns the full HTML page with DOCTYPE, , , and .

SSRServer

Properties:

  • port: number – Port for the server.
  • pagesDir: string – Directory with precompiled pages.
  • publicDir: string – Directory with static assets.

Methods:

  • init(): void – Starts the HTTP server for SSR.

Folder Structure

/dist/src/app         # Compiled page modules
/public           # Static assets
/src/
    index.ts # SSRServer class
    /app # Pages
    /componentes # Components
README.md

Licence

MIT © Leonardo Augusto Valério