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

@arraypress/blocklist

v1.0.0

Published

Email, IP, and word blocklist matching. Supports domains, wildcards, and CIDR ranges.

Downloads

67

Readme

@arraypress/blocklist

Email, IP, and word blocklist matching. Zero dependencies.

Uses the Fetch API — works in Cloudflare Workers, Node.js 18+, Deno, Bun, and browsers.

Installation

npm install @arraypress/blocklist

Usage

import { isEmailBlocked, isIPBlocked, containsBlockedWord } from '@arraypress/blocklist';

isEmailBlocked('[email protected]', '@*.ru');           // true
isIPBlocked('10.0.0.5', '10.0.0.0/24');           // true
containsBlockedWord('Buy now free stuff', 'buy now\nfree stuff'); // true

API

isEmailBlocked(email, rules)

Check if an email address is blocked. Rules can be a newline-separated string or an array.

function isEmailBlocked(email: string, rules: string | string[]): boolean

Supported rule formats:

| Format | Example | Matches | | ----------------- | ------------------- | ------------------------------------ | | Full email | [email protected] | Exact match only | | Domain | @example.com | All emails from that domain | | Wildcard TLD | @*.ru | All .ru domains | | Wildcard subdomain| @*.example.com | All subdomains of example.com |

isEmailBlocked('[email protected]', '@*.ru');                    // true
isEmailBlocked('[email protected]', '@disposable.email'); // true
isEmailBlocked('[email protected]', '@*.ru');                  // false

// Using an array of rules
isEmailBlocked('[email protected]', ['@throwaway.io', '@*.ru']);  // true

isIPBlocked(ip, rules)

Check if an IPv4 address is blocked. Rules can be a newline-separated string or an array.

function isIPBlocked(ip: string, rules: string | string[]): boolean

Supported rule formats:

| Format | Example | Matches | | ---------- | -------------- | ------------------------------ | | Exact IP | 1.2.3.4 | That single IP | | CIDR range | 10.0.0.0/24 | 10.0.0.0 through 10.0.0.255 |

isIPBlocked('10.0.0.5', '10.0.0.0/24');  // true
isIPBlocked('10.0.1.5', '10.0.0.0/24');  // false
isIPBlocked('1.2.3.4', '1.2.3.4');       // true

containsBlockedWord(text, rules)

Check if text contains any blocked words or phrases. Case-insensitive substring matching.

function containsBlockedWord(text: string, rules: string | string[]): boolean
containsBlockedWord('Buy now and get free stuff!', 'buy now\nfree stuff');  // true
containsBlockedWord('Great product, highly recommend', 'spam\nbuy now');     // false

findBlockedWords(text, rules)

Find which blocked words are present in the text. Returns an array of matched words.

function findBlockedWords(text: string, rules: string | string[]): string[]
const matches = findBlockedWords('Buy now and get free stuff!', 'buy now\nfree stuff\nspam');
// => ['buy now', 'free stuff']

parseBlocklist(text)

Parse a newline-separated blocklist string into an array of trimmed, lowercased, non-empty entries. Lines starting with # are treated as comments and ignored.

function parseBlocklist(text: string): string[]
const rules = parseBlocklist(`
  # Disposable email providers
  @mailinator.com
  @guerrillamail.com
  @*.ru
`);
// => ['@mailinator.com', '@guerrillamail.com', '@*.ru']

License

MIT