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

aphid-abuseipdbv2-com

v1.0.0

Published

TypeScript skeleton for typed API wrappers: describe endpoints, send them through an injected transport.

Readme

This is a demo repo meant to demonstrate how to use aphid for use cases where you have to write the code by hand.

If you want a proper wrapper, you should look into making your own or taking a look at abuseipdb-client by athur-melo

Usage

Every endpoint of AbuseIPDB APIv2 is a function returning an Operation, which builds no request and performs no I/O until an ApiClient is handed it. Point the client at the v2 base URL and put your API key in the Key header (this API does not use Authorization: Bearer).

import {
	ApiClient,
	bulkReport,
	clearAddress,
	getBlacklist,
	getBlacklistPlaintext,
	getCheck,
	getCheckBlock,
	getReports,
	report,
	ReportCategory,
	toBulkReportCsv,
} from "@Smiduweorc/AphidTemplate";
import { withRetry } from "@Smiduweorc/AphidTemplate/transport";
import { isCidr, isIpV4 } from "@Smiduweorc/AphidTemplate";

const api = new ApiClient({
	baseUrl: "https://api.abuseipdb.com/api/v2",
	headers: { Key: process.env.ABUSEIPDB_KEY!, accept: "application/json" },
	// Optional. Backs off on 429 and 5xx, and leaves POSTs alone.
	transport: withRetry(fetch),
});

const address = "118.25.6.39";
if (!isIpV4(address)) throw new Error("not an address");

// GET /check
const check = await api.request(getCheck(address, 90, true));

// GET /reports
const page = await api.request(getReports(address, { page: 1, perPage: 100 }));

// GET /blacklist, as JSON or as one address per line
const list = await api.request(getBlacklist({ limit: 1000, confidenceMinimum: 90 }));
const lines = await api.request(getBlacklistPlaintext({ limit: 1000 }));

// POST /report
await api.request(
	report({
		ip: address,
		categories: [ReportCategory.Ssh, ReportCategory.BruteForce],
		comment: "Failed SSH logins",
	})
);

// GET /check-block
const network = "127.0.0.1/24";
if (isCidr(network)) {
	const block = await api.request(getCheckBlock(network, 30));
}

// POST /bulk-report
await api.request(
	bulkReport(
		toBulkReportCsv([
			{
				ip: address,
				categories: [ReportCategory.PortScan],
				timestamp: new Date(),
				comment: "Port scan",
			},
		])
	)
);

// DELETE /clear-address, which removes your own reports only
await api.request(clearAddress(address));

Numeric parameters with documented bounds (maxAgeInDays, limit, confidenceMinimum, page, perPage) are checked at compile time when you pass a literal: getCheck(ip, 400) does not compile. A value whose type is plain number is passed through unchecked, since there is no literal to compare.

Failures arrive as TransportError, HttpError or DecodeError, all of which extend ApiError. AbuseIPDB signals a plan limit (a network wider than your tier allows, a subscriber-only blacklist filter) as an HttpError with status 402, and a rate limit as a 429 carrying Retry-After.