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

@roboteby/parry

v2.0.1

Published

Application-layer security middleware for Express that combines abuse detection, request guards, rate limiting, brute-force protection and security observability.

Readme

Parry

npm version license node

Application-layer security middleware for Express that combines abuse detection, request guards, rate limiting, brute-force protection and security observability.

The current stable release is @roboteby/[email protected] on the npm latest dist-tag.

Install

npm install @roboteby/parry express@^5.2.1

Parry 2 requires Node.js >=22 and Express ^5.2.1.

Minimal example

const express = require('express');
const { createParry } = require('@roboteby/parry');

const app = express();
app.use(express.json({ limit: '64kb' }));

const parry = createParry({ preset: 'recommended' });
app.use(parry.middleware());

app.get('/health', (_req, res) => res.json({ ok: true }));
app.listen(3000);

Body parsers must run before Parry when request bodies should be inspected. Mount Parry before the routes it protects.

Main capabilities

  • Request Shape limits for depth, key count, array length and string length.
  • Heuristic SQL injection and XSS detection, plus NoSQL operator guards.
  • HTTP parameter pollution, prototype pollution and path traversal guards.
  • Global and route-specific rate limiting.
  • Brute-force counters and temporary blocks for authentication routes.
  • Sanitized Threat Events, process-local metrics and an optional read-only Admin API.
  • In-memory state by default, with an optional RedisStore for shared protection state.

Security boundaries

Parry is a defense-in-depth control for the Express application layer. It is not a WAF and does not replace a CDN, reverse proxy, load balancer or volumetric L3/L4 DDoS protection. It also does not replace authentication, authorization, schema validation, parameterized queries, context-aware escaping/output encoding or CSP.

SQLi and XSS detection is heuristic, so false positives and false negatives are possible. Request Shape runs before heavier scans to bound their cost, but an allowed request is not proof that its input is safe for downstream use.

Trusted proxy handling depends on narrow, correct trustedProxies configuration. See the security model before enabling forwarded-header trust.

Public API

The recommended root exports are:

  • createParry(options) — creates the middleware and its observability context.
  • createParryAdminRouter(parry, options) — creates the optional Admin router.
  • MemoryStore — keeps protection state in one process.
  • RedisStore — uses an application-owned Redis client for shared protection state.

Existing exports remain available. Parry_DDoS(options) is a deprecated compatibility wrapper around createParry(options).middleware(), and Parry_DDoSOptions is a deprecated TypeScript alias for ParryOptions.

Advanced typed exports are available from /core, /detectors, /stores, /policies, /brute-force, /events, /observability and /admin.

Admin API

The Admin API exposes health, process metrics, recent sanitized events, active bans and normalized policies. It is never mounted automatically and fails during construction unless authentication is configured:

const { createParryAdminRouter } = require('@roboteby/parry');

app.use(
  '/_parry',
  createParryAdminRouter(parry, {
    auth: {
      mode: 'token',
      token: process.env.PARRY_ADMIN_TOKEN,
    },
  })
);

Anonymous Admin access is an explicit local-development opt-in and is rejected in production. External identity modes depend on a configured trusted boundary; Parry does not perform cryptographic JWT/JWKS verification, and verifyJwt: true fails explicitly.

See Admin API for authentication modes and deployment guidance.

Redis

The application creates and connects the Redis client. Parry does not install or own a Redis package implicitly.

const { createClient } = require('redis');
const { createParry, RedisStore } = require('@roboteby/parry');

const client = createClient({ url: process.env.REDIS_URL });
await client.connect();

const parry = createParry({
  store: new RedisStore({ client, prefix: 'parry' }),
  storeFailureMode: 'fail-closed',
});

RedisStore shares rate-limit state, brute-force state, counters and related bans/blocks across instances. Threat Events, the default event buffer and metrics remain local to each process unless the application exports them.

Runtime support

  • Node.js >=22
  • Express ^5.2.1
  • CommonJS

CI covers Node.js 22 and 24. Parry 2 does not imply or announce an ESM migration.

Documentation

See CONTRIBUTING.md for the development workflow and SECURITY.md for vulnerability reporting.

License

MIT