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

@harshalkatakiya/http-status

v1.0.2

Published

A comprehensive collection of HTTP status codes and their standard phrases.

Readme

@harshalkatakiya/http-status

A comprehensive collection of HTTP status codes and their standard phrases.

Features

  • 🚀 Comprehensive: Includes a wide range of HTTP status codes and phrases.
  • 📘 TypeScript Support: Written in TypeScript with full type definitions.
  • 📚 Documentation: Includes JSDoc comments with links to official RFC documentation for each status code.
  • 📦 Zero Dependencies: Lightweight and easy to include in any project.
  • 🔄 Dual Export: Access codes and phrases separately or together.

Installation

You can install this package using your preferred package manager:

# npm
npm install @harshalkatakiya/http-status

# yarn
yarn add @harshalkatakiya/http-status

# pnpm
pnpm add @harshalkatakiya/http-status

# bun
bun add @harshalkatakiya/http-status

Usage

Importing Codes

You can import HTTP status codes directly:

import { Codes } from "@harshalkatakiya/http-status";

console.log(Codes.OK); // 200
console.log(Codes.NOT_FOUND); // 404
console.log(Codes.INTERNAL_SERVER_ERROR); // 500

// Use in your response handling
if (response.status === Codes.UNAUTHORIZED) {
  // Handle unauthorized access
}

Importing Phrases

You can also import the standard phrases associated with each status code:

import { Phrases } from "@harshalkatakiya/http-status";

console.log(Phrases.OK); // "OK"
console.log(Phrases.NOT_FOUND); // "Not Found"
console.log(Phrases.INTERNAL_SERVER_ERROR); // "Internal Server Error"

// Send a response with a standard message
res.status(404).send(Phrases.NOT_FOUND);

Using Both

You can use both codes and phrases together for clear and readable code:

import { Codes, Phrases } from "@harshalkatakiya/http-status";

app.get("/", (req, res) => {
  res.status(Codes.OK).send(Phrases.OK);
});

app.post("/create", (req, res) => {
  // ... creation logic
  res.status(Codes.CREATED).send({ message: Phrases.CREATED });
});

Direct Imports

You can also import specific codes and phrases directly from their subpaths. This is useful for tree-shaking and keeping your bundle size small.

import {
  OK,
  NOT_FOUND,
  INTERNAL_SERVER_ERROR,
} from "@harshalkatakiya/http-status/codes";
import {
  OK as OK_PHRASE,
  NOT_FOUND as NOT_FOUND_PHRASE,
} from "@harshalkatakiya/http-status/phrases";

console.log(OK); // 200
console.log(OK_PHRASE); // "OK"

res.status(NOT_FOUND).send(NOT_FOUND_PHRASE);

API Reference

The package exports two main objects: Codes and Phrases. Both objects share the same keys, representing the HTTP status.

Common Status Codes

| Key | Code | Phrase | | ----------------------- | ---- | --------------------- | | OK | 200 | OK | | CREATED | 201 | Created | | ACCEPTED | 202 | Accepted | | NO_CONTENT | 204 | No Content | | MOVED_PERMANENTLY | 301 | Moved Permanently | | BAD_REQUEST | 400 | Bad Request | | UNAUTHORIZED | 401 | Unauthorized | | FORBIDDEN | 403 | Forbidden | | NOT_FOUND | 404 | Not Found | | METHOD_NOT_ALLOWED | 405 | Method Not Allowed | | INTERNAL_SERVER_ERROR | 500 | Internal Server Error | | BAD_GATEWAY | 502 | Bad Gateway | | SERVICE_UNAVAILABLE | 503 | Service Unavailable |

Note: This is not an exhaustive list. The package includes many more standard and non-standard status codes.

License

This project is licensed under the MIT License.

Author

Harshal Katakiya