├── .gitignore ├── .gitattributes ├── .travis.yml ├── .editorconfig ├── readme.md ├── package.json ├── test.js ├── index.js └── license /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '8' 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # http-status-emojis [![Build Status](https://travis-ci.org/bendrucker/http-status-emojis.svg?branch=master)](https://travis-ci.org/bendrucker/http-status-emojis) [![Greenkeeper badge](https://badges.greenkeeper.io/bendrucker/http-status-emojis.svg)](https://greenkeeper.io/) 2 | 3 | > Emojis for HTTP status codes 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save http-status-emojis 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | const statusEmojis = require('http-status-emojis') 17 | 18 | console.log(statusEmojis[500]) 19 | // => 💣 20 | ``` 21 | 22 | Open a pull request to add new emojis! 23 | 24 | 25 | ## License 26 | 27 | MIT © [Ben Drucker](http://bendrucker.me) 28 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "http-status-emojis", 3 | "main": "index.js", 4 | "version": "2.2.0", 5 | "description": "Emojis for HTTP status codes", 6 | "license": "MIT", 7 | "repository": "bendrucker/http-status-emojis", 8 | "author": { 9 | "name": "Ben Drucker", 10 | "email": "bvdrucker@gmail.com", 11 | "url": "bendrucker.me" 12 | }, 13 | "scripts": { 14 | "test": "standard && tape test.js" 15 | }, 16 | "keywords": [ 17 | "http", 18 | "status", 19 | "code", 20 | "emojis" 21 | ], 22 | "devDependencies": { 23 | "array-duplicates": "^1.0.1", 24 | "standard": "^14.0.0", 25 | "tape": "^5.0.0" 26 | }, 27 | "files": [ 28 | "index.js", 29 | "test.js" 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /test.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | const test = require('tape') 4 | const duplicates = require('array-duplicates') 5 | const httpStatusEmojis = require('./') 6 | 7 | test('all properties are strings', function (t) { 8 | t.ok(Object.values(httpStatusEmojis).every(validCodePoint), 'all code points are valid (> 5000)') 9 | for (const [key, value] of Object.entries(httpStatusEmojis)) { 10 | if (!validCodePoint(value)) { 11 | t.fail(`expected emoji, found "${value}" at "${key}"`) 12 | } 13 | } 14 | t.end() 15 | }) 16 | 17 | test('all values are unique', function (t) { 18 | const d = duplicates(Object.values(httpStatusEmojis)) 19 | const has = d.length 20 | 21 | t.notOk(has, 'should not have duplicates') 22 | d.forEach(value => t.fail(`duplicate: ${value}`)) 23 | 24 | t.end() 25 | }) 26 | 27 | function validCodePoint (value) { 28 | // arbitrary, helps catch obvious mistakes 29 | return value.codePointAt(0) > 5000 30 | } 31 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | 100: '🏁', 5 | 200: '✅', 6 | 201: '📝', 7 | 202: '🔄', 8 | 204: '💭', 9 | 300: '🔀', 10 | 301: '🚚', 11 | 302: '🔎', 12 | 303: '📨', 13 | 304: '💠', 14 | 305: '🔁', 15 | 306: '🔃', 16 | 307: 'ℹ️', 17 | 308: '🆕', 18 | 400: '🚫', 19 | 401: '🔐', 20 | 402: '💰', 21 | 403: '⛔', 22 | 404: '❓', 23 | 405: '❗', 24 | 406: '🛡', 25 | 407: '🔩', 26 | 408: '⌛️', 27 | 409: '💥', 28 | 410: '💨', 29 | 411: '📏', 30 | 412: '🛑', 31 | 413: '🗃', 32 | 414: '🆖', 33 | 415: '📼', 34 | 416: '📐', 35 | 417: '🤔', 36 | 418: '🍵', 37 | 421: '🔂', 38 | 422: '💩', 39 | 423: '🔒', 40 | 424: '🧶', 41 | 425: '⏱', 42 | 426: '📤', 43 | 428: '⛓', 44 | 429: '🌋', 45 | 431: '🤮', 46 | 444: '🗑', 47 | 451: '⚖️', 48 | 494: '🧾', 49 | 495: '🏅', 50 | 496: '🏷', 51 | 499: '🚶🏽', 52 | 497: '❎', 53 | 500: '💣', 54 | 501: '📭', 55 | 502: '🚧', 56 | 503: '🚨', 57 | 504: '⏲', 58 | 505: '🕯', 59 | 506: '☢️', 60 | 507: '💯', 61 | 508: '➰', 62 | 509: '🧮', 63 | 510: '🏗', 64 | 511: '🔑' 65 | } 66 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Ben Drucker (bendrucker.me) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | --------------------------------------------------------------------------------