Catalog npm
PACKAGE EXPLORERView in registry

418-teapot

npm

An Express middleware that refuses to brew coffee (HTTP 418).

418coffeeexpressmiddlewareteapot
Versions collected1
Direct dependencies1From release 1.0.0
Last observed20 Oct, 19:58 UTC

README

Current package documentation

418-teapot 🫖☕

A lightweight, fun Express.js middleware that strictly enforces RFC 2324 by refusing to brew coffee.

If a route using this middleware is hit, the server will immediately respond with the classic HTTP 418 "I'm a teapot" status code and message.

Installation

You can install this package using npm:

npm install 418-teapot

(Note: express is required as a peer dependency.)

Usage

Simply import the middleware and apply it to any Express route where coffee brewing is strictly prohibited.

const express = require('express');
const teapot = require('418-teapot');

const app = express();
const PORT = 3000;

// Apply the teapot middleware to the coffee route
app.get('/coffee', teapot.middleware);

app.listen(PORT, '0.0.0.0', () => {
  console.log(`Server is running on port ${PORT}!`);
});

The Response

When a client makes a GET request to /coffee, they will receive an HTTP 418 status code along with the following JSON response:

{
  "code": 418,
  "message": "I'm a teapot",
  "description": "The server refuses to brew coffee because it is, permanently, a teapot."
}

API Reference

The module exports the middleware function alongside the raw HTTP 418 data object, giving you flexibility in how you use it.

const teapot = require('418-teapot');

console.log(teapot.code); 
// Returns: 418

console.log(teapot.message); 
// Returns: "I'm a teapot"

console.log(teapot.description); 
// Returns: "The server refuses to brew coffee because it is, permanently, a teapot."

License

This project is licensed under the MIT License.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.0Registry latest22 Jun 20261

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:58 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:00c639f80578f5d5f7e0fe12865a495ce9b433a522345aae763f8796730eeb17