{"id":13233,"library":"github-api-emojis","title":"GitHub API Emojis","description":"The `github-api-emojis` package provides a static, pre-compiled list of emoji names available in the GitHub API. It exports two main structures: a flat array (`list`) containing all emoji names as strings, and an object (`map`) where emoji names are keys with a placeholder value (typically `1`) for efficient lookup. This library is designed for quick, synchronous access to GitHub emoji data without requiring any network requests. It is currently at version 1.0.4 and has a very slow release cadence, primarily for documentation updates or minor corrections, suggesting high stability. Its key differentiator is its minimal footprint and static nature, making it ideal for environments where a dynamic API call is unnecessary or undesired, and only the emoji names are required, not their images or full metadata.","status":"active","version":"1.0.4","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/IonicaBizau/github-api-emojis","tags":["javascript","github","api","emojis","the","list","of","emoji","names"],"install":[{"cmd":"npm install github-api-emojis","lang":"bash","label":"npm"},{"cmd":"yarn add github-api-emojis","lang":"bash","label":"yarn"},{"cmd":"pnpm add github-api-emojis","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is CommonJS-only. For ESM environments, use dynamic import() or ensure correct CJS interop.","wrong":"import GitHubApiEmojis from 'github-api-emojis';","symbol":"GitHubApiEmojis","correct":"const GitHubApiEmojis = require(\"github-api-emojis\");"},{"note":"The direct export for the map is located under the 'lib/' subdirectory, and requires CommonJS syntax.","wrong":"import { map } from 'github-api-emojis';","symbol":"emojisMap","correct":"const emojisMap = require(\"github-api-emojis/lib/map\");"},{"note":"The direct export for the list is located under the 'lib/' subdirectory, and requires CommonJS syntax.","wrong":"import { list } from 'github-api-emojis';","symbol":"emojisList","correct":"const emojisList = require(\"github-api-emojis/lib/list\");"}],"quickstart":{"code":"const GitHubApiEmojis = require(\"github-api-emojis\");\nconst emojisMap = require(\"github-api-emojis/lib/map\");\nconst emojisList = require(\"github-api-emojis/lib/list\");\n\nconsole.log('--- Full List (first 10) ---');\nconsole.log(GitHubApiEmojis.list.slice(0, 10));\n\nconsole.log('\\n--- Filtered List (startsWith \"heart\") ---');\nconsole.log(emojisList.filter(c => c.startsWith(\"heart\")));\n\nconsole.log('\\n--- Map Lookup for \"tada\" ---');\nif (emojisMap[\"tada\"]) {\n    console.log(\"Yay, 'tada' exists!\");\n} else {\n    console.log(\"'tada' does not exist.\");\n}","lang":"javascript","description":"This quickstart demonstrates how to import and use the emoji list and map, both from the main export and directly from their respective paths, for checking emoji existence and filtering."},"warnings":[{"fix":"Use `require()` syntax for imports or ensure your build pipeline correctly handles CommonJS module interop for ESM.","message":"This package is exclusively CommonJS (`require`). Attempting to use `import` statements directly in an ECMAScript Module (ESM) environment without proper transpilation or bundling will lead to runtime errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Periodically check for new package versions, especially if GitHub has recently added new emojis that your application requires.","message":"The emoji data provided by this package is static and compiled at the time of release. It does not fetch updates from the GitHub API dynamically. New emojis introduced by GitHub will not appear in this package until a new version is published and installed.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"When using `emojisMap`, only use it for boolean checks (e.g., `if (emojisMap[name])`) rather than expecting a specific data payload from the value.","message":"The `map` export provides an object where emoji names are keys and their values are `1`. This value is a placeholder and should only be used to check for the existence of an emoji name, not to retrieve any meaningful data associated with the emoji itself.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Always specify the full path including `/lib/` when requiring specific exports: `require(\"github-api-emojis/lib/list\")`.","message":"When directly importing the `list` or `map` exports, the correct path includes the `/lib/` directory (e.g., `github-api-emojis/lib/list`). Omitting `/lib/` will result in a 'module not found' error.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"If in an ESM project, use dynamic `import()` or ensure your build setup correctly handles CommonJS modules. If using Node.js, ensure your file is treated as CommonJS (e.g., a `.js` file without `\"type\": \"module\"` in `package.json`, or a `.cjs` file).","cause":"Attempting to use `require()` in an ECMAScript Module (ESM) context without proper transpilation or bundling.","error":"ReferenceError: require is not defined"},{"fix":"Change the import path to `require(\"github-api-emojis/lib/list\")` or `require(\"github-api-emojis/lib/map\")`.","cause":"Incorrect import path; the direct exports `list` and `map` are located under the `lib/` directory.","error":"Cannot find module 'github-api-emojis/list'"},{"fix":"Use the correct CommonJS `require` pattern: `const GitHubApiEmojis = require(\"github-api-emojis\");` then access `GitHubApiEmojis.list`. If in ESM, try `import * as GitHubApiEmojis from 'github-api-emojis';` or stick to dynamic `import()`.","cause":"Occurs if `require(\"github-api-emojis\")` is used with `import GitHubApiEmojis from 'github-api-emojis'` in an ESM context, and the bundler does not correctly interop, leading `GitHubApiEmojis` to be `undefined`. Alternatively, if the main export is incorrectly assumed to be a default export when it's a CommonJS module exporting an object.","error":"TypeError: Cannot read properties of undefined (reading 'list')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":""}