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 🙏

© 2024 – Pkg Stats / Ryan Hefner

http-status-message

v1.2.4

Published

A utility for generating user-friendly messages based on HTTP status codes and message tone.

Downloads

1,237

Readme

http-status-message

http-status-message is an npm package that provides a collection of status code messages tailored for various tones, suitable for displaying in web applications, APIs, or any other software that communicates HTTP status codes to users.

Installation

You can install http-status-message using npm:

npm install http-status-message

Usage

const { getStatusMessage } = require('http-status-message');
// or
import { getStatusMessage } from 'http-status-message'; // ES6 import syntax

// Get a formal message along with corresponding emoji for status code 404
const message = getStatusMessage(404, 'formal');
console.log(message);

API

getStatusMessage(statusCode, messageTone)

Returns an object containing a message string and an emoji corresponding to the given HTTP status code and tone.

  • statusCode (number): The HTTP status code (e.g., 200, 404, 500).
  • messageTone (string): The tone of the message.
    • Available options: formal, informal, straightforward, technical, funny, empathetic, educational, short.

Available Message Tones

(all lower case)

  • formal: Polite and professional tone suitable for official communication.
  • informal: Casual and friendly tone for a more relaxed atmosphere.
  • straightforward: Direct and clear tone without any frills.
  • technical: Tone tailored for technical audiences with precise language.
  • funny: Humorous tone to lighten the mood and engage users.
  • empathetic: Compassionate and understanding tone for delicate situations.
  • educational: Informative tone providing explanations and guidance.
  • short: Concise tone providing the official HTTP MDN documentation messages.

Contributing

Contributions are welcome! If you have suggestions for improvements, new features, or encounter any issues, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.