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

fail2ban-node

v1.0.0

Published

A maintained Node.js client for fail2ban, wrapping fail2ban-client CLI

Readme

fail2ban-node

A maintained Node.js client for fail2ban, wrapping the fail2ban-client CLI.

Why

Existing npm packages for fail2ban are unmaintained and rely on fragile Python pickle socket communication. This package uses the official fail2ban-client CLI — the stable, version-agnostic interface.

Requirements

  • Node.js >= 18
  • fail2ban-client installed on the system (Linux only)

Install

pnpm add fail2ban-node
# or
npm install fail2ban-node

Usage

const fail2ban = require('fail2ban-node');

// Check if fail2ban is running
const alive = await fail2ban.ping();

// Get all jails
const { total, list } = await fail2ban.status();
// { total: 2, list: ['sshd', 'nginx-http-auth'] }

// Get jail details
const jail = await fail2ban.jailStatus('sshd');
// {
//   currentlyFailed: 3,
//   totalFailed: 81,
//   fileList: ['/var/log/auth.log'],
//   currentlyBanned: 2,
//   totalBanned: 15,
//   bannedIPs: ['1.2.3.4', '5.6.7.8']
// }

// Ban an IP
await fail2ban.ban('sshd', '1.2.3.4');

// Unban an IP
await fail2ban.unban('sshd', '1.2.3.4');

// Reload configuration
await fail2ban.reload();

// Unban all IPs across all jails
await fail2ban.unbanAll();

API

| Method | Description | |--------|-------------| | ping() | Check if fail2ban is running. Returns boolean. | | status() | Get total jail count and jail list. | | jailStatus(jail) | Get detailed status for a specific jail. | | ban(jail, ip) | Ban an IP in a jail. | | unban(jail, ip) | Unban an IP from a jail. | | reload() | Reload fail2ban configuration. | | unbanAll() | Unban all IPs across all jails. |

License

GPL-2.0 — same as fail2ban itself.