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

@hanykholey/axiscloud-sdk

v1.0.0

Published

Express middleware for per-IP rate limiting and request logs batching with GeoIP lookup.

Readme

AxisCloud SDK (Rate Limiting + Request Logs)

A small library that provides rate limiting + request logs batching as an Express middleware.

The package name in package.json is: axiscloud-sdk.

Overview

  • Rate limiting is applied per IP using node-cache.
  • Captures request data (User-Agent / IP / Path / Country) and buffers logs.
  • When buffered logs reach 30 logs, they are sent in one batch to a backend endpoint.
  • Country is resolved via GeoLite2-Country.mmdb using maxmind, with per-IP country caching.

Requirements

  • Node.js (recommended 18+)
  • Express (this library exposes a middleware)
  • GeoLite2-Country.mmdb must exist in the project root (or the process working directory at runtime)

Installation

If you are using the project locally from source:

npm install
npm run build

If you are installing it as a package (depending on your publishing setup):

npm i axiscloud-sdk

Note: the library depends on Express + got + maxmind + node-cache.

Quick Start (Express Middleware)

import express from "express";
import { Logs } from "axiscloud-sdk";

const app = express();
app.use(express.json());

// Logs(apiKey, countRequest, timeCache)
// apiKey: your project key
// countRequest: max allowed requests per IP within the window
// timeCache: window size in seconds
app.use(Logs("YOUR_API_KEY", 100, 60));

app.get("/Test", (req, res) => {
  res.status(200).json({ message: "api is work" });
});

app.listen(3001, () => console.log("Server is Start..."));

Configuration

Main exported function:

  • Logs(apiKey: string, countRequest: number, timeCache: number)

Parameters

  • apiKey
    • Sent along with logs to the backend.
  • countRequest
    • Maximum number of requests per IP within the timeCache window.
    • When exceeded, the middleware responds with 429:
      • {"message":"To Many Requests"}
  • timeCache
    • Window size (in seconds) used to count requests.

Sending Logs to the Backend

Logs are buffered and sent when the buffer size becomes >= 30 to a hardcoded endpoint:

  • POST http://localhost:3000/CreateLog

Request body:

{
  "sentLogs": [
    {
      "userAgent": "...",
      "ip": "...",
      "path": "/...",
      "country": "EG"
    }
  ],
  "apiKey": "YOUR_API_KEY"
}

Important Notes

  • GeoIP database path is currently used like this:
    • maxmind.open("./GeoLite2-Country.mmdb")
    • This means GeoLite2-Country.mmdb must be available in the process working directory when your server runs.
  • backendUrl and frontendUrl are currently hardcoded (localhost) in the source. If you want them to be configurable via options/env vars, tell me and I’ll refactor it.

Build

npm run build

Build output will be generated in dist/.