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

@techiev2/vajra

v1.4.1

Published

Blazing-fast, zero-dependency Node.js server with routing, middleware, multipart uploads, and templating. 111 lines · ~95k req/s · ~52 MB idle.

Readme

Vajra ⚡

Vajra Thunderbolt

Ultra-minimal, zero-dependency Node.js HTTP server
Routing · Middleware · Multipart parsing · HTML templating
All in 111 lines of pure JavaScript

Name Origin

Vajra draws from the Rigvedic thunderbolt weapon of Indra — crafted from the bones of Sage Dadhichi, symbolizing unbreakable strength through selfless sacrifice.

Like the Vajra, this server delivers maximum power in minimal form.

npm version npm downloads Node.js version License

Changelog

1.4.1 (Current)

  • Added support to handle drift in system time after signing

1.4.0 (2025-12-31)

  • Added full HS256 JWT support (@techiev2/vajra/libs/auth/jwt.js)
    • Ultra-minimal, zero-dependency implementation
    • Key and header caching for maximum performance
    • Robust base64url handling
    • Numeric exp validation and expiration checks

1.3.0 (2025-12-30)

  • Performance improvements to routing in bare routes

1.2.0 (2025-12-30)

  • Adds cookie support

1.0.0 (2025-12-25)

  • Initial release

Features

  • Zero external dependencies
  • Built-in routing with named parameters (:id)
  • Asynchronous batched logging for performance
  • Global middleware support with next() chaining
  • JSON, urlencoded, and multipart/form-data body parsing
  • Fast HTML templating with loops, nested objects, and simple array headers
  • Helper methods: res.json(), res.html(), res.status(), res.writeMessage()
  • Payload size limiting with 413 responses
  • Sensible defaults for 404/405/500

Performance (Apple M4, Node 20+)

| Test Case | Vajra | Express + Multer | Notes | |------------------------------------------------|----------------|------------------|---------------------------| | 1MB Multipart Upload (wrk -t16 -c600) | ~94–98k req/s | ~72k req/s | +30% faster | | Idle RSS | ~52–53 MB | ~44 MB | Zero deps vs extra packages | | Peak RSS under load | ~228 MB | ~209 MB | Full buffering trade-off | | Code size (source) | 111 lines | ~2k+ lines | Hand-crafted minimalism |

Performance Benchmarks (wrk)

wrk multipart benchmarks on M4 and VPS

Installation

npm install vajra

Quick Start

import Vajra from '../index.js';
import { encode } from 'node:querystring';

async function getUsers(query = {}) {
  return (await fetch(`https://jsonplaceholder.typicode.com/users?${encode(query)}`)).json()
}

const { get, post, use, start, setProperty, log } = Vajra.create();

setProperty({ viewsRoot: `${import.meta.url}/views` })
// Or as a key-value pair
// setProperty('viewsRoot', `${import.meta.url}/views`)

use((req, res, next) => {
  // Vajra provides an async batched logger to provide a balance between 100% log coverage and performance.
  // If you prefer blocking immediate logs, you can switch to console.log
  // or any other library of your choice.
  log(`${req.method} ${req.url}`);
  next();
});

get('/', (req, res) => {
  res.writeMessage('Hello from Vajra ⚡');
});

post('/upload', (req, res) => {
  res.json({ received: true, filesCount: req.files.length, files: req.files, body: req.body });
});

start({ port: 4002 }, () => {
  console.log('Ready at http://localhost:4002');
});

get('/api/users', async ({ query }, res) => {
  const users = await getUsers(query)
  return res.json({ users })
})

get('/web/users', async ({ query }, res) => {
  const users = await getUsers(query)
  const headers = Object.keys(users[0])
  return res.html(`users.html`, { users, headers })
})

HTML Templating

import Vajra from '../index.js';
const { get, post, use, start, setProperty } = Vajra.create();

get('/users', (req, res) => {
  const data = {
    users: [
      { id: 1, name: 'Alice' },
      { id: 2, name: 'Bob' }
    ],
    headers: ['ID', 'Name']
  };

  // If no view root is set, .html() expects the absolute path.
  res.html('views/users.html', data);
});

views/users.html

<table>
  <thead>
    {{# headers }}
      <th>{{ header@ }}</th>
    {{/ headers }}
  </thead>
  <tbody>
    {{# users }}
      <tr>
        <td>{{ id }}</td>
        <td>{{ name }}</td>
      </tr>
    {{/ users }}
  </tbody>
</table>

Supports:

  • Loops ({{# array }} ... {{/ array }})
  • Dot notation ({{ user.name }})
  • Special header shorthand ({{ header@ }} for simple arrays)

Configuration

const app = vajra.create({
  maxFileSize: 10 // in MB (default: 2)
});

// Set view root path
app.setProperty('viewRoot', './views');

API

  • get/post/put/patch/delete/head/options(path, handler)
  • use(middleware)
  • start({ port, host }, callback?)
  • setProperty(key, value) or setProperty({ key: value })
  • log(message)

Response helpers:

res.status(code) res.json(data) res.writeMessage(text) res.html(pathOrString, data)

Philosophy

Vajra is built on the principle that minimalism can maximise outcomes.

Everything you need for real internal tools, admin panels, APIs, and prototypes — without the bloat.

No dependencies. No build step. Just copy index.js and go.

Benchmarks & Memory

Run under extreme multipart load (wrk -t16 -c600 -d30s 1MB payloads):

Throughput: ~95k req/s Idle RSS: ~52 MB Peak under load: ~228 MB (drops back on idle)

License

MIT

Credits

Hand-crafted by [Sriram Velamur/@techiev2]

Inspired by the desire for a truly tiny, powerful, and dependency-free Node server.