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

@shresht7/http-status-codes

v0.1.2

Published

<h1> HTTP Status Codes</h1>

Downloads

259

Readme

A lightweight TypeScript library providing HTTP status code enums with descriptions, reverse lookups, and type guards.

📦 Install

Deno (JSR)

deno add jsr:@shresht7/http-status-codes

npm (Node)

npm install @shresht7/http-status-codes

📖 Usage

import { Status, Code } from 'jsr:@shresht7/http-status-codes'

Status.INFORMATION.PROCESSING  //  102
Status.SUCCESS.OK              //  200
Status.CLIENT_ERROR[404]       //  NOT_FOUND

Code.BAD_GATEWAY               //  502
Code[200]                      //  OK

Status

| Status Type | Series | Description | | --------------------- | ------ | --------------------------------------------------------------- | | Status.INFORMATION | 1xx | The request was received and understood, continuing process | | Status.SUCCESS | 2xx | Request was received, understood, and accepted | | Status.REDIRECT | 3xx | Additional action requested from client. Mainly URL Redirection | | Status.CLIENT_ERROR | 4xx | Request cannot be fulfilled due to a client side error | | Status.SERVER_ERROR | 5xx | Request cannot be fulfilled due to a server side error |

Status.INFORMATION.PROCESSING   //  102
Status.SUCCESS.OK               //  200
Status.CLIENT_ERROR[404]        //  NOT_FOUND

Code

Code.SWITCHING_PROTOCOLS        //  101
Code.CREATED                    //  201
Code.BAD_REQUEST                //  400
Code[301]                       //  MOVED_PERMANENTLY

StatusText

import { Status, Code, StatusText } from 'jsr:@shresht7/http-status-codes'

StatusText(Code.CONTINUE)                           //  Continue
StatusText(Status.INFORMATION.SWITCHING_PROTOCOLS)  //  Switching Protocols
StatusText(404)                                     //  Not Found

StatusText can be given a custom formatter to customize the output string.

StatusText(Status.CLIENT_ERROR.NOT_FOUND, (text: string) => {
    return `[${Code[text]} - ${text}]: Nothing to see here!`
})
//  [404 - NOT_FOUND]: Nothing to see here!

Checks

isStatus | isInformation | isSuccess | isRedirect | isClientError | isServerError | isError

import {
    Code,
    Status,
    isStatus,
    isInformation,
    isSuccess,
    isRedirect,
    isClientError,
    isServerError,
    isError
} from 'jsr:@shresht7/http-status-codes'

isStatus(Status.REDIRECT.MOVED_PERMANENTLY)             //  true
isStatus(Code.BAD_REQUEST)                              //  true
isStatus(502)                                           //  true
isStatus(987)                                           //  false

isInformation(Status.INFORMATION.SWITCHING_PROTOCOLS)   //  true
isInformation(Code.INTERNAL_SERVER_ERROR)               //  false  

isSuccess(200)                                          //  true
isSuccess(Code.NOT_FOUND)                               //  false

isRedirect(301)                                         //  true

isClientError(404)                                      //  true
isServerError(404)                                      //  false
isError(404)                                            //  true

JSON

The json/ directory contains the same status codes in plain JSON, useful for non-TypeScript consumers.

  • Status.json: Categorized by series (INFORMATION, SUCCESS, REDIRECT, CLIENT_ERROR, SERVER_ERROR)
  • StatusCodes.json: Flat map of all codes
{
  "100": { "name": "CONTINUE", "description": "Server received request headers…" },
  "200": { "name": "OK", "description": "Standard response for successful HTTP requests…" }
}

These are generated from the source JSDoc via scripts/generate-json.ps1.


📕 References


📑 License

MIT License