Registry / http-networking / github-api-emojis

github-api-emojis

JSON →
library1.0.4jsnpmunverified

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.

npm install github-api-emojis
INSTALL
IMPORT
SIG · GITHUB-API-EMOJIS
G
github-api-emojis
http-networkingjavascriptv1.0.4
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

GitHubApiEmojis
const GitHubApiEmojis = require("github-api-emojis");
import GitHubApiEmojis from 'github-api-emojis';
This package is CommonJS-only. For ESM environments, use dynamic import() or ensure correct CJS interop.
emojisMap
const emojisMap = require("github-api-emojis/lib/map");
import { map } from 'github-api-emojis';
The direct export for the map is located under the 'lib/' subdirectory, and requires CommonJS syntax.
emojisList
const emojisList = require("github-api-emojis/lib/list");
import { list } from 'github-api-emojis';
The direct export for the list is located under the 'lib/' subdirectory, and requires CommonJS syntax.

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.

const GitHubApiEmojis = require("github-api-emojis"); const emojisMap = require("github-api-emojis/lib/map"); const emojisList = require("github-api-emojis/lib/list"); console.log('--- Full List (first 10) ---'); console.log(GitHubApiEmojis.list.slice(0, 10)); console.log('\n--- Filtered List (startsWith "heart") ---'); console.log(emojisList.filter(c => c.startsWith("heart"))); console.log('\n--- Map Lookup for "tada" ---'); if (emojisMap["tada"]) { console.log("Yay, 'tada' exists!"); } else { console.log("'tada' does not exist."); }
Debug
Known issues
gotchaThis 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.
fix
Use `require()` syntax for imports or ensure your build pipeline correctly handles CommonJS module interop for ESM.
affects: >=1.0.0
gotchaThe 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.
fix
Periodically check for new package versions, especially if GitHub has recently added new emojis that your application requires.
affects: >=1.0.0
gotchaThe `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.
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.
affects: >=1.0.0
gotchaWhen 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.
fix
Always specify the full path including `/lib/` when requiring specific exports: `require("github-api-emojis/lib/list")`.
affects: >=1.0.0
Errors
Common errors & fixes
ReferenceError: require is not defined
Attempting to use `require()` in an ECMAScript Module (ESM) context without proper transpilation or bundling.
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).
Cannot find module 'github-api-emojis/list'
Incorrect import path; the direct exports `list` and `map` are located under the `lib/` directory.
fix
Change the import path to `require("github-api-emojis/lib/list")` or `require("github-api-emojis/lib/map")`.
TypeError: Cannot read properties of undefined (reading 'list')
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.
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()`.
Upgrade
Version history
1.0.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
github-api-emojis — npm install github-api-emojis · libregistry