npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

http-status-lite

v0.1.14

Published

A collection of commonly used HTTP status codes for applications.

Readme

http-status-lite

The http-status-lite is a lightweight and comprehensive utility providing standardized HTTP status codes for applications. It simplifies the handling of HTTP response codes by offering predefined constants, ensuring clarity and consistency in API responses.

Table of Contents


Key Features

  1. Predefined HTTP Status Codes: Provides a comprehensive set of HTTP status codes for easy reference.
  2. TypeScript Support: Includes strong type definitions for enhanced code safety and developer experience.
  3. Immutable Constants: Ensures status codes cannot be modified, preventing unintended changes.
  4. Lightweight & Efficient: Minimal footprint with high performance.
  5. Easy Integration: Seamlessly integrates with any Node.js or TypeScript-based project.

Installation

To install the package, run the following command:

npm install http-status-lite

or

yarn add http-status-lite

or

pnpm add http-status-lite

or

bun add http-status-lite

Usage

JavaScript CommonJS Example

const httpStatusLite = require('http-status-lite');

console.log(httpStatusLite.OK); // Outputs: 200

JavaScript ESM Example

import httpStatusLite from 'http-status-lite';

console.log(httpStatusLite.OK); // Outputs: 200

const successStatus: HttpStatusType = 'OK';
console.log(httpStatusLite[successStatus]); // Outputs: 200

TypeScript ESM Example

import httpStatusLite, { HttpStatusType } from 'http-status-lite';

console.log(httpStatusLite.OK); // Outputs: 200

const successStatus: HttpStatusType = 'OK';
console.log(httpStatusLite[successStatus]); // Outputs: 200

HTTP Status Code Categories

Informational Responses (100–199)

  • CONTINUE: 100
  • SWITCHING_PROTOCOLS: 101
  • PROCESSING: 102
  • EARLY_HINTS: 103

Successful Responses (200–299)

  • OK: 200
  • CREATED: 201
  • ACCEPTED: 202
  • NO_CONTENT: 204
  • PARTIAL_CONTENT: 206

Redirection Messages (300–399)

  • MULTIPLE_CHOICES: 300
  • MOVED_PERMANENTLY: 301
  • FOUND: 302
  • SEE_OTHER: 303
  • TEMPORARY_REDIRECT: 307
  • PERMANENT_REDIRECT: 308

Client Error Responses (400–499)

  • BAD_REQUEST: 400
  • UNAUTHORIZED: 401
  • FORBIDDEN: 403
  • NOT_FOUND: 404
  • METHOD_NOT_ALLOWED: 405
  • TOO_MANY_REQUESTS: 429
  • UNAVAILABLE_FOR_LEGAL_REASONS: 451

Server Error Responses (500–599)

  • INTERNAL_SERVER_ERROR: 500
  • NOT_IMPLEMENTED: 501
  • BAD_GATEWAY: 502
  • SERVICE_UNAVAILABLE: 503
  • GATEWAY_TIMEOUT: 504

License

by-nc-nd/4.0

This project is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International (CC BY-NC-ND 4.0).

You are free to:

  • Share — Copy and redistribute the material in any medium or format.

Under the following terms:

  • Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made.
  • NonCommercial — You may not use the material for commercial purposes.
  • NoDerivatives — If you remix, transform, or build upon the material, you may not distribute the modified material.

For more details, please visit the Creative Commons License Page.


Acknowledgments

Special thanks to the following resources:

  1. MDN Web Docs - Comprehensive HTTP status code references.
  2. Node.js Express Documentation - Guidance on handling HTTP responses.
  3. TypeScript Docs - Best practices for defining and using type-safe constants.

FAQs

1. How do I determine the correct HTTP status code for my response?

HTTP status codes are categorized based on their meaning. Informational (100s), Success (200s), Redirection (300s), Client Errors (400s), and Server Errors (500s). Choose the appropriate category based on your response type.

2. Can I extend this library with custom status codes?

No, the constants are immutable and follow the official HTTP status codes. If needed, you can create a wrapper module to include your custom codes.

3. How do I uninstall the package?

You can remove the package by running:

npm uninstall http-status-lite

or

yarn remove http-status-lite

or

pnpm remove http-status-lite

or

bun remove http-status-lite

Author