README
🤔 About
This package provides a single enum (HTTPStatusCodes
) that maps human-readable names to status codes... that's all.
This package was created specifically for KangoJS with the intention of reducing third party dependencies.
Obviously there are already many npm packages that offer this exact functionality perfectly fine such as http-status-codes which would be a better fit for general use.
🚀 Getting Started
Install the npm package:
npm install @kangojs/http-status-codes
👷 Usage
Simply import the package and use the enum where it's needed:
import { HTTPStatusCodes } from '@kangojs/http-status-codes';
// will output 404
console.log(HTTPStatusCodes.NOT_FOUND)
// will output 503
console.log(HTTPStatusCodes.SERVICE_UNAVAILABLE)
NOTE: This is purposefully not an exhaustive list at the moment, it's just the ones I've found myself actually needing.
🧰 Other KangoJS Packages
For all available KangoJS packages check out this list.
💬 Feedback & Contributions
I'm open to feedback and contributions. Feel free to raise an issue or suggest improvements and features.
📝 License
This project is licensed under the terms of the MIT license.