http-status-emojis is a minimalist JavaScript library that provides a direct mapping of common HTTP status codes to relevant Unicode emojis. Currently at version 2.2.0, it exposes a simple, immutable object where keys are numeric HTTP status codes (e.g., 200, 404, 500) and values are corresponding emojis (e.g., 'โ ', 'โ', '๐ฃ'). The package is highly stable with a generally slow release cadence, typically updated to add new emojis or address minor issues rather than introduce breaking API changes. Its key differentiator is its single-purpose design, offering a straightforward and zero-dependency solution for visually representing HTTP statuses in contexts such as logs, command-line tools, or user interfaces where a quick, intuitive status indicator is beneficial.
npm install http-status-emojisVerified import paths โ ran on the pinned version, not inferred.
This quickstart demonstrates how to import the `http-status-emojis` object and access emojis for various HTTP status codes, including handling codes without a direct emoji mapping and listing all available entries.
For CommonJS projects, use `const statusEmojis = require('http-status-emojis');`. For ESM projects, `import statusEmojis from 'http-status-emojis';` should work, but be mindful of module resolution specifics.Test emoji rendering in all target environments. For critical visual consistency, consider using image-based icons instead of Unicode emojis.
Use a fallback emoji or text for unmapped status codes, e.g., `statusEmojis[code] || 'โ'`.
Ensure the import/require statement is correct for your module system (CommonJS: `const statusEmojis = require('http-status-emojis');` or ESM: `import statusEmojis from 'http-status-emojis';`) and that the package is installed (`npm install http-status-emojis`).Access status emojis as properties of the `statusEmojis` object using bracket notation (e.g., `statusEmojis[200]`) rather than calling it as a function.
No dependency data recorded yet.