Convenience helpers for sending consistent HTTP success responses.
These complement the errors module — together they replace all direct res.status().json() calls in route handlers with named, intention-revealing functions.
errors
res.status().json()
// Instead of:res.status(201).json({ id: user.id })// Use:Created(res, { id: user.id }) Copy
// Instead of:res.status(201).json({ id: user.id })// Use:Created(res, { id: user.id })
Description
Convenience helpers for sending consistent HTTP success responses.
These complement the
errorsmodule — together they replace all directres.status().json()calls in route handlers with named, intention-revealing functions.Example