@c9up/blackhole
v0.1.10
Published
Blackhole — Rust-native security filter (XSS, CSRF, rate-limiting) for any Node.js framework
Readme
@c9up/blackhole
Rust-native security filter (XSS, CSRF, rate-limiting, CORS, security headers) for any Node.js framework.
Part of Ream — a Rust-powered, AdonisJS-compatible Node.js framework. Independent, publishable package.
Installation
pnpm add @c9up/blackhole
ream configure @c9up/blackholeUsage
Ream — register the middleware:
// start/kernel.ts
router.use([() => import('@c9up/blackhole/middleware')])Express / Fastify — standalone adapters:
import { blackholeExpress } from '@c9up/blackhole/express'
// `secret` is REQUIRED when CSRF is on (signed double-submit, fail-closed).
// The Ream provider defaults it from APP_KEY; the standalone adapters do not,
// so pass your app key explicitly here.
app.use(blackholeExpress({
secret: process.env.APP_KEY,
csrf: true,
rateLimit: { max: 100, windowSeconds: 60 },
}))Entry points
@c9up/blackhole— main API@c9up/blackhole/middleware— Ream middleware@c9up/blackhole/provider— Ream IoC provider@c9up/blackhole/config—defineConfig()helper@c9up/blackhole/express— Express adapter@c9up/blackhole/fastify— Fastify adapter
License
MIT
