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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@brahimemo/standard-js

v1.0.3

Published

A JavaScript/TypeScript library that provides type definitions and predefined constants inspired by the Go standard library.

Readme

Standard-JS Package

The standard-js package provides common types and constants for HTTP methods, status codes, mathematical constants, and date/time formats. It is designed to simplify development in your applications by offering predefined values that can be easily imported and used.

Installation

To install this module, you can use npm, Yarn, Bun, or pnpm:

npm install @brahimemo/standard-js
yarn add @brahimemo/standard-js
bun install @brahimemo/standard-js
pnpm add @brahimemo/standard-js

Usage

Importing HTTP Methods

You can import the HTTP methods and use them in your application:

import { HTTPMethods } from "@brahimemo/standard-js/http";

console.log(HTTPMethods.Get); // "GET"
console.log(HTTPMethods.Post); // "POST"

Importing HTTP Status Codes

You can also import the HTTP status codes:

import { StatusCodes } from "@brahimemo/standard-js/http";

console.log(StatusCodes.StatusOK); // 200
console.log(StatusCodes.StatusNotFound); // 404

Available HTTP Methods

  • GET
  • HEAD
  • POST
  • PUT
  • PATCH
  • DELETE
  • CONNECT
  • OPTIONS
  • TRACE

Available HTTP Status Codes

  • 1xx Informational

    • StatusContinue (100)
    • StatusSwitchingProtocols (101)
    • StatusProcessing (102)
    • StatusEarlyHints (103)
  • 2xx Success

    • StatusOK (200)
    • StatusCreated (201)
    • StatusAccepted (202)
    • StatusNoContent (204)
  • 3xx Redirection

    • StatusMovedPermanently (301)
    • StatusFound (302)
    • StatusNotModified (304)
  • 4xx Client Errors

    • StatusBadRequest (400)
    • StatusUnauthorized (401)
    • StatusNotFound (404)
  • 5xx Server Errors

    • StatusInternalServerError (500)
    • StatusNotImplemented (501)

Importing Mathematical Constants

You can import mathematical constants like this:

import { Math } from "@brahimemo/standard-js/math";

console.log(Math.Pi); // 3.141592653589793
console.log(Math.Expo); // 2.718281828459045

Available Mathematical Constants

  • Math.Expo
  • Math.Pi
  • Math.Phi
  • Math.Sqrt2
  • Math.SlfE
  • Math.Ln2
  • And more...

Importing Date/Time Formats

You can import date and time formats as follows:

import { Formats } from "@brahimemo/standard-js/time";

console.log(Formats.RFC3339); // "yyyy-MM-ddTHH:mm:ssZ"
console.log(Formats.Kitchen); // "h:mma"

Available Date/Time Formats

  • Formats.Layout
  • Formats.ANSIC
  • Formats.RFC3339
  • Formats.Kitchen
  • And more...

Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes and commit them (git commit -m 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.