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

@quoriel/api

v1.5.2

Published

ForgeScript extension for building fast and scalable HTTP APIs using uWebSockets.js

Readme

QuorielAPI

A high-performance extension for ForgeScript that provides a reliable and scalable way to build HTTP APIs using uWebSockets.js.

Installation

npm i @quoriel/api uNetworking/uWebSockets.js#v20.52.0

Connection

const { ForgeClient } = require("@tryforge/forgescript");
const { QuorielApi } = require("@quoriel/api");

const client = new ForgeClient({
    extensions: [
        new QuorielApi({
            port: 3000,        // HTTP server port (default: 3000)
            path: "routes",    // Routes directory path
            cacheIP: 10000,    // Cache up to 10,000 converted IP addresses (optional)
            ssl: {             // SSL options for HTTPS (optional)
                cert_file_name: "cert.pem",
                key_file_name: "key.pem"
            },
            allowed: {         // Global access control (optional)
                hosts: ["api.quoriel.com"],
                ips: {
                    white: ["243.117.6.40", "198.140.170.153"],
                    black: ["30.164.62.195"]
                },
                headers: {
                    "Authorization": "Bearer your-token-here"
                }
            },
            throttle: {        // Rate limiting and burst protection (optional)
                rateWindowMs: 120000,
                rateMaxRequests: 75,
                blockDuration: 365000
            }
        })
    ]
});

client.login("...");

Cache

Caching of converted IP addresses for performance optimization.

cacheIP: 10000  // Cache up to 10,000 converted IP addresses (optional)

[!TIP] IP caching significantly improves performance by storing IP addresses in string format, avoiding repeated conversions from binary buffers.

SSL

For HTTPS support, provide SSL options. If SSL options are present, the server will use SSLApp, otherwise it will use regular App.

ssl: {
    cert_file_name: "path/to/cert.pem",     // SSL certificate file
    key_file_name: "path/to/key.pem",       // Private key file
    passphrase: "your_passphrase",          // Password for encrypted private key
    ca_file_name: "path/to/ca.pem",         // Certificate Authority chain file
    ssl_ciphers: "ECDHE-RSA-AES128-...",    // Allowed SSL cipher suites
    ssl_prefer_low_memory_usage: true       // Optimize for lower memory usage
}

[!TIP] Available SSL options: See uWebSockets.js AppOptions

Allowed

Access control mechanism for routes that can be configured globally or for individual routes.

allowed: {
    hosts: [],        // Array of allowed hostnames
    ips: {
        white: [],    // Only these IPs are allowed
        black: []     // These IPs are blocked
    },
    headers: {}       // Required request headers
}

Structure (Route)

  • false - disable access control for this route
  • true or (if not specified at all) - use global rules only
  • { merge: true, ... } - merge route settings with global rules (route takes priority)
  • { ... } - apply route settings only (ignore global)

Throttle

Request rate limiting and burst protection to prevent abuse and automated attacks.

throttle: {
    rateWindowMs: 60000,          // Rate limit window duration (default: 60000ms = 1 minute)
    rateMaxRequests: 60,          // Max requests per rate window (default: 60)
    burstWindowMs: 1000,          // Burst detection window duration (default: 1000ms = 1 second)
    burstMaxRequests: 3,          // Max requests per burst window (default: 3)
    blockDuration: 600000,        // Block duration in milliseconds (default: 600000ms = 10 minutes)
    cleanupIntervalMs: 180000,    // Cleanup interval for tracking data (default: 180000ms = 3 minutes)
    maxTrackedIPs: 1500,          // Maximum IPs to track simultaneously (default: 1500)
    logBlocks: false              // Log blocked IPs to console (default: false)
}

How it works

The throttle system uses two-layer protection:

  1. Rate Limiting - tracks total requests over a longer time window (e.g., 60 requests per minute)
  2. Burst Protection - detects rapid request spikes in short intervals (e.g., 3 requests per second)

[!IMPORTANT] When limits are exceeded, the IP is automatically blocked for a configured duration. Burst violations result in 2x longer blocks.

Structure

  • false - disable throttle completely
  • true - enable with default settings
  • { ... } - enable with custom parameters

[!NOTE] Individual routes can only enable or disable throttle using throttle: false or throttle: true in the route definition. Custom throttle parameters cannot be configured per route, only globally.

Routes

Each route is defined as a module inside the routes directory.

module.exports = {
    url: "/*",
    method: "GET",
    code: `$sendText[Hello world!]`
};

Supported methods

GET, POST, PUT, DELETE, PATCH, OPTIONS, HEAD, TRACE, CONNECT, ANY