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

blizzardts

v0.1.9

Published

Ultra-lightweight, high-performance TypeScript micro-framework for Bun

Downloads

14

Readme

❄️ BlizzardTS

The Ultra-Lightweight, High-Performance TypeScript Framework for Bun

Version License Runtime TypeScript PRs Welcome


✨ Why BlizzardTS?

Di era modern ini, kita butuh tools yang gak cuma cepet saat runtime, tapi juga cepet saat development. BlizzardTS hadir buat kamu yang pengen:

  • Blazing Fast: Dibangun di atas native API Bun, performanya ngebut banget!
  • 🛡️ Type-Safe: Full TypeScript support dari hulu ke hilir. Autocomplete-nya manja banget.
  • 🧩 Modular & Flexible: Pake apa yang kamu butuh aja. Middleware system-nya gampang diatur.
  • 🔒 Secure by Default: Udah ada built-in security headers dan rate limiter. Aman terkendali.
  • 🍃 Ultra Lightweight: Ukuran package kecil, gak bikin node_modules kamu bengkak.

📦 Installation

Gampang banget, tinggal sat set pake Bun:

bun add blizzardts

Atau kalau kamu tim npm/yarn/pnpm (tapi serius, cobain Bun deh):

npm install blizzardts

🚀 Quick Start

Bikin file index.ts, terus copas kode ini. Dijamin langsung jalan!

import { Blizzard } from "blizzardts";

const app = Blizzard();

// Route sederhana
app.get("/", (c) => {
  return c.text("Hello, Blizzard! ❄️");
});

// JSON Response? Gampang!
app.get("/api/status", (c) => {
  return c.json({
    status: "ok",
    uptime: process.uptime(),
    message: "Server is running smoothly! 🏃‍♂️"
  });
});

// Jalanin servernya
Bun.serve({
  fetch: app.fetch,
  port: 3000
});

console.log("Server running on http://localhost:3000 🚀");

Jalanin pake:

bun run index.ts

📚 Core Features & Usage

1. Routing yang Ekspresif 🛣️

BlizzardTS support semua HTTP method standar. Kamu bisa definisiin route dengan gaya yang clean.

app.get("/users", (c) => c.text("List Users"));
app.post("/users", (c) => c.text("Create User"));
app.put("/users/:id", (c) => c.text(`Update User ${c.req.params.id}`));
app.delete("/users/:id", (c) => c.text(`Delete User ${c.req.params.id}`));

Grouping Routes

Biar rapi, kelompokin route kamu pake group. Cocok banget buat API versioning.

app.group("/api/v1", (api) => {
  api.get("/users", (c) => c.json({ users: [] }));
  api.post("/auth/login", (c) => c.json({ token: "secret" }));
});

2. Context (c) yang Powerful 🧰

Parameter c (Context) di setiap handler itu "kantong ajaib" kamu. Isinya lengkap:

  • Request Data:

    • c.req.json(): Ambil body JSON (otomatis diparsing).
    • c.req.query("key"): Ambil query param.
    • c.req.params: Ambil route param.
    • c.req.headers: Akses header request.
  • Response Helper:

    • c.json(data): Kirim JSON response.
    • c.text(string): Kirim text response.
    • c.html(string): Kirim HTML response.
    • c.status(code): Set HTTP status code.
    • c.redirect(url): Redirect user.

3. Middleware System 🔗

Middleware di BlizzardTS itu chainable dan gampang dibuat. Bisa global, bisa per-route.

Global Middleware

Jalan di semua request. Contoh: Logger.

app.use(async (c, next) => {
  console.log(`[${c.req.method}] ${c.req.path}`);
  await next(); // Lanjut ke handler berikutnya
});

Route-Specific Middleware

Cuma jalan di route tertentu. Contoh: Auth check.

const authMiddleware = async (c, next) => {
  const token = c.req.headers.get("Authorization");
  if (!token) return c.status(401).json({ error: "Unauthorized" });
  await next();
};

app.get("/protected", authMiddleware, (c) => {
  return c.json({ secret: "Data Rahasia 🤫" });
});

4. Validation dengan Zod 💎 (New in v0.1.5)

Validasi input user itu wajib hukumnya. BlizzardTS integrasi langsung sama Zod biar validasi kamu type-safe dan deklaratif.

import { zValidator } from "blizzardts";
import { z } from "zod";

const userSchema = z.object({
  username: z.string().min(3),
  email: z.string().email(),
  age: z.number().min(18)
});

app.post("/register", zValidator("json", userSchema), (c) => {
  // Data di sini udah pasti valid dan typed!
  const data = (c.req as any).valid.json; 
  return c.json({ message: "Registered!", user: data });
});

5. Security Features 🛡️ (New in v0.1.5)

Jangan biarin aplikasi kamu telanjang. BlizzardTS punya fitur keamanan bawaan.

Rate Limiter

Cegah spam dan DDoS ringan dengan membatasi jumlah request.

import { rateLimiter } from "blizzardts";

// Maksimal 100 request per 15 menit per IP
app.use(rateLimiter({
  windowMs: 15 * 60 * 1000,
  max: 100,
  message: "Too many requests, please try again later."
}));

Secure Headers

Tambahin header keamanan standar (Helmet-style) otomatis.

import { secureHeaders } from "blizzardts";

app.use(secureHeaders());
// Otomatis nambahin X-XSS-Protection, X-Frame-Options, dll.

💡 Advanced Example

Gabungin semuanya jadi satu aplikasi API yang robust.

import { Blizzard, rateLimiter, secureHeaders, zValidator } from "blizzardts";
import { z } from "zod";

const app = Blizzard();

// 1. Global Middlewares
app.use(secureHeaders());
app.use(rateLimiter({ windowMs: 60000, max: 20 })); // 20 req/menit

// 2. Schema Validation
const loginSchema = z.object({
  email: z.string().email(),
  password: z.string().min(6)
});

// 3. Routes
app.get("/", (c) => c.text("Welcome to Secure Blizzard API ❄️"));

app.group("/api", (api) => {
  api.post("/login", zValidator("json", loginSchema), (c) => {
    const { email } = (c.req as any).valid.json;
    return c.json({ token: "fake-jwt-token", user: email });
  });

  api.get("/profile", (c) => {
    // Simulasi auth check
    const auth = c.req.headers.get("Authorization");
    if (!auth) return c.status(401).json({ error: "No token provided" });
    return c.json({ id: 1, name: "Fauzan", role: "Admin" });
  });
});

// 4. Error Handling
app.onError((err, c) => {
  console.error(err);
  return c.status(500).json({ error: "Something went wrong!" });
});

app.notFound((c) => c.status(404).json({ error: "Route not found" }));

export default app;

🤝 Contributing

Kita seneng banget kalau kamu mau kontribusi! Entah itu benerin typo, nambah fitur, atau lapor bug. Langsung aja buka Issue atau bikin Pull Request di repo ini.

Let's build the coolest framework together! ❄️


📄 License

BlizzardTS dilisensikan di bawah MIT License. Bebas pake buat project personal atau komersial.