gracely is a lightweight TypeScript library for creating structured, HTTP-friendly error objects suitable for REST API responses. Version 2.0.13 is stable with a low release cadence. It provides a set of factory functions (e.g., badRequest, notFound) that generate standardized error payloads with status codes, messages, and optional details. Unlike generic error classes, gracely focuses on REST semantics and integrates cleanly with frameworks like Express or Fastify. Ships TypeScript types.
npm install gracelyNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating structured REST error responses using gracely's factory functions and type guard.
Use ES module imports (import { ... } from 'gracely') instead of require().Use 'internalServerError' instead of 'serverError'.
Use gracely.fail() or specific factory functions like badRequest() to create errors.
Use import type { NotFoundError } from 'gracely' for TypeScript type annotations.Install the package: npm install gracely
Use named import: import { badRequest } from 'gracely'Switch to ES module imports in your project (type: 'module' in package.json) and use import { ... } from 'gracely'.No dependency data recorded yet.