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

axiscloud-sdk

v1.0.3

Published

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

Downloads

50

Readme

AxisCloud SDK (Rate Limiting + Request Logs)

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

Works with:

  • ESM (import)
  • CommonJS (require)
  • JavaScript + TypeScript (types included)

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

How It Works

  • Rate limiting: Per IP using node-cache. When limit exceeded → 429 Too Many Requests.
  • Logging: Captures userAgent, ip, path, country. Logs are buffered and sent in batches when they reach 30 entries.
  • Country: Resolved via GeoLite2-Country.mmdb (optional). If missing, country = UNKNOWN.
  • Backend endpoint: POST http://localhost:3000/CreateLog (hardcoded for now).

Requirements

  • Node.js (recommended 18+)
  • Express (this library exposes a middleware)
  • GeoLite2-Country.mmdb is optional. If it is not found, the library will set country to UNKNOWN.

Installation

npm i axiscloud-sdk

Note: the library depends on maxmind + node-cache. HTTP is done via built-in fetch.

Quick Start

  1. Install the package:
npm i axiscloud-sdk
  1. Add this to your package.json scripts:
{
  "scripts": {
    "setup:geo": "axiscloud-geo-download",
    "start": "npm run setup:geo && node server.js"
  }
}
  1. Create server.js:
import express from "express";
import { Logs } from "axiscloud-sdk";

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

// Logs(apiKey, maxRequests, windowSeconds)
app.use(Logs("YOUR_API_KEY", 100, 60));

app.get("/test", (req, res) => {
  res.json({ message: "OK" });
});

app.listen(3001, () => console.log("Server running on port 3001"));
  1. Run:
npm start

That's it! The database will be downloaded automatically and your server will start.

GeoLite2 Database (Country Detection)

Optional: If you don’t set this up, country will be UNKNOWN.

Manual setup (if you don’t use the script above)

Run this in your project root:

axiscloud-geo-download

This downloads GeoLite2-Country.mmdb into your project.

Alternative: Use your own file

If you already have the file, set the path:

Environment variable:

set GEOLITE2_COUNTRY_DB_PATH=C:\path\to\GeoLite2-Country.mmdb
node server.js

From code:

import { setGeoDBPath } from "axiscloud-sdk";
setGeoDBPath("C:/path/to/GeoLite2-Country.mmdb");

API

Logs(apiKey, maxRequests, windowSeconds)
  • apiKey (string): Sent with logs to the backend.
  • maxRequests (number): Max requests per IP within the window.
  • windowSeconds (number): Time window in seconds.

Response when rate limited

{
  "message": "To Many Requests"
}

Log Format (Backend)

When the buffer reaches 30 entries, logs are sent to:

POST http://localhost:3000/CreateLog

Body:

{
  "sentLogs": [
    {
      "userAgent": "Mozilla/5.0...",
      "ip": "192.168.1.1",
      "path": "/api/test",
      "country": "EG"
    }
  ],
  "apiKey": "YOUR_API_KEY"
}

Notes

  • If the GeoLite2 DB file is missing, the library does not crash—country simply becomes UNKNOWN.
  • Backend URL is currently hardcoded to localhost:3000. Want it configurable? Let me know.
  • Works with both ESM (import) and CommonJS (require).

Development (If you’re contributing)

npm run build

Outputs:

  • dist/ (ESM)
  • dist-cjs/ (CommonJS)