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 🙏

© 2025 – Pkg Stats / Ryan Hefner

turbo-dynamic-html

v1.0.2

Published

A turbo-charged dynamic HTML generator for modern web applications

Readme

Turbo Dynamic HTML

Turbo Dynamic HTML

npm version npm downloads License: MIT TypeScript

WARNING: This package only sutaible for module js not common js. if you want to stay with common js do not declare "type": "commonjs" on package json and ignore some warning related to types.

Superfast JavaScript template engine for dynamic Webapplication

A lightweight, high-performance template built for speed and efficiency. Turbo Dynamic HTML is designed to outperform existing template engines with its optimized architecture, file-based routing system, and efficient rendering capabilities.


Quick Start

Installation

# Using npm
npm install turbo-dynamic-html

# Using bun
bun add turbo-dynamic-html

# Using yarn
yarn add turbo-dynamic-html

Recomended Extensions

Althought there are Many extensions on vscode that provides user snipit but we are recommending to use is julienetie.vscode-template-literals https://marketplace.visualstudio.com/items?itemName=julienetie.vscode-template-literals extension for better suggestions.

Basic Usage

import TDH from "turbo-dynamic-html";
import express from "express";
import path from "path";
TDH.__init__({
  TDH_RENDER_PATH: path.join(process.cwd(), "pages"),
});

const app = express();

app.use(express.static("public"));
app.use(async (req, res, next) => {
  const html = await TDH.render(req.path, renderDataHere);
  if (html) {
    res.contentType("html");
    res.send(html);
  } else next();
});

app.listen(3000, () => {
  console.log("server started at port 3000");
});

Features

  • Lightning Fast: Optimized for maximum performance with raw TypeScript/JavaScript
  • File-based Routing: Automatic route generation based on file structure
  • Layout System: Nested layout support with automatic composition
  • Built-in Caching: Optional Redis caching for production environments
  • TypeScript First: Written in TypeScript with full type safety
  • Zero Dependencies: Minimal footprint with no external runtime dependencies
  • Dynamic/Static Pages: Support for both dynamic and static page generation
  • Flexible Architecture: Works with any Node.js framework or runtime

Documentation

File-based Routing

Create your templates in organized directory structures:

views/
├── _layout.ts
├── index.ts              -> /
├── about.ts              -> /about
└── blog/
    ├── index.ts          -> /blog
    └── [slug].ts         -> /blog/:slug(EXPERIMENTAL)

Template Syntax

import { generateTDHPage } from "turbo-dynamic-html";

const page = generateTDHPage({
  render(data: YourDataType) {
    return `<section>Your page content here</section>
`;
  },
});

export default page;

Layout Syntext

import { generateTDHLayout } from "turbo-dynamic-html";

const layout = generateTDHLayout({
  render(data, children) {
    return html`<!DOCTYPE html>
      <html lang="en">
        <head>
          <meta charset="UTF-8" />
          <meta
            name="viewport"
            content="width=device-width, initial-scale=1.0"
          />
          <title>Your Title</title>

          <link rel="preconnect" href="https://fonts.googleapis.com" />
          <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
          <link rel="stylesheet" href="style.css" />
        </head>
        <body>
        <!-- Your Headers -->
          <header class="site-header">
           Your Header
          </header>

          <main class="site-content">${children}</main>

          <footer class="site-footer">
            Your Footer
          </footer>
        </body>
      </html>`;
  },
});
export default layout;

Development Status

Current Version: Alpha (v1.0.0-beta.X.X)

We are continusly working to imporve our Template Engine to improve performance boost:

Completed Features

  • Basic template compilation and rendering
  • File-based routing foundation
  • TypeScript support

In Progress

  • Integrate with express
  • Redis Catching
  • Maybe on future gzip

Contributing

We welcome contributions! Please read our Contributing Guide for details.

Development Setup

# Clone the repository
git clone https://github.com/ayush-panday-dev/turbo-dynamic-html.git
cd turbo-dynamic-html

# Install dependencies
npm install

# Run in development mode
npm run dev

# Build the project
npm run build

# Run tests
npm test

Compatibility

  • Node.js: 16.x, 18.x, 20.x, 22.x
  • Bun: 1.x+
  • Frameworks: Express, Fastify, NestJS
  • TypeScript: 5.X+

Support


Made with ❤️ by Ayush Panday

Turbo Dynamic HTML - Where performance meets simplicity