roastttp
v0.1.0
Published
HTTP status codes with attitude. A CLI + Express middleware that roasts your responses.
Maintainers
Readme
roastttp
HTTP status codes with attitude. A tiny CLI and Express middleware that roasts your responses so your terminal feels a little more alive.
GET /api/v1/nothing → 404 NOT FOUND · 67ms
┌───────────────┐
│ MISSING │
│ │
│ [ ? ? ] │
│ │
│ HAVE YOU │
│ SEEN THIS │
│ ENDPOINT? │
└───────────────┘
🥛 NOT FOUND ¯\_(ツ)_/¯
"check the path. check it again. it's still wrong."- Zero runtime dependencies
- Works in any terminal (colors, emoji, and ASCII art all have graceful fallbacks)
- 28 status codes, 160+ roasts, 10 hand-drawn ASCII scenes for the heroes
- CLI + Express middleware in the same package
install
# try it without installing
npx roastttp https://httpbin.org/status/500
# install globally
npm install -g roastttp
# or add to your project for the middleware
npm install roastttpNode 18+ required (we use native fetch).
CLI
# hit a URL, get a reaction
roastttp https://httpbin.org/status/418
# other methods
roastttp -X POST -d '{"x":1}' -H "content-type: application/json" https://httpbin.org/post
# render a specific code without a network call
roastttp --code 503
# see every reaction in one scroll
roastttp --preview
# list every code we have a reaction for
roastttp --listFlags:
--minimal— hide the ASCII art blocks, keep emoji + roast--no-color— disable ANSI colors (also honored viaNO_COLOR=1)--no-emoji— strict ASCII mode for old terminals-X, --method <verb>— HTTP method (defaultGET)-H, --header "key: value"— add a header (repeatable)-d, --data <body>— request body--code <n>— render the reaction for a given code, no request--preview— sample gallery across tiers--list— list supported codes-h, --help— help-v, --version— version
Exit codes follow convention: 0 for 2xx/3xx responses, 1 for 4xx/5xx (so you can use roastttp in CI checks).
Express middleware
import express from 'express';
import { roastttp } from 'roastttp/express';
const app = express();
app.use(roastttp());
app.get('/hello', (_req, res) => res.send('hi'));
app.get('/oops', (_req, res) => res.status(500).send('bad day'));Now your terminal prints a reaction line beneath every 4xx/5xx response, right after your existing access logs. Your logs stay exactly as they were — this just appends.
options
app.use(roastttp({
reactOn: [404, 500], // only react to specific codes
// reactOn: (code) => code >= 400, // or a predicate
rarity: 0.3, // 30% chance of reacting (prevents habituation)
silent2xx: true, // don't roast successes (default: true)
minimal: false, // hide ASCII art
noColor: false, // disable colors
noEmoji: false, // strict ASCII mode
stream: process.stdout, // where to write (default: stdout)
}));how it picks reactions
Every known status code has 3–6 roast lines. Each request picks one at random, so running the same failing endpoint a few times doesn't show the same joke every time. Hero codes (500, 404, 418, 503, 429, and a few others) get a multi-line ASCII art block above the roast.
Colors follow status class: green for 2xx, cyan for 3xx, yellow for 4xx, red for 5xx.
adding your own roasts
The catalog lives at src/data/reactions.json. PRs welcome — see CONTRIBUTING.md for the house style and examples. One-line PRs are the fastest path.
demos
Runnable examples live in demo/:
demo/cli.sh— CLI walkthroughdemo/express-server.js— Express middleware demodemo/library-usage.js— usingrender()directly in your own code
Next.js, Fastify, Hono adapters?
Planned. Express first because its middleware API is stable and obvious. Next.js needs logger monkey-patching which gets fragile; a fetch-wrapper style integration is likely coming first. Fastify and Hono should land soon.
license
MIT. See CHANGELOG.md for release history.
