Registry / data / emojibase

emojibase

JSON →
library0.0.2jsnpmunverified

Emojibase is a comprehensive JavaScript library providing lightweight, up-to-date, and localized emoji JSON datasets, alongside utility functions and regex patterns for working with emoji characters. It is currently stable at version 17.0.0, which aligns with Emoji v17 and CLDR 48, reflecting its regular cadence of updates with new Unicode and CLDR releases. Key differentiators include its direct construction from official Unicode emoji data sources, adherence to Unicode Technical Standard #51, and localization capabilities derived from UTS #35, ensuring high accuracy and broad language support. The library aims to provide a robust and specification-compliant solution for emoji handling in various applications.

npm install emojibase
INSTALL
IMPORT
SIG · EMOJIBASE
E
emojibase
datajavascriptv0.0.2
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.

getEmojiData
import { getEmojiData } from 'emojibase';
const { getEmojiData } = require('emojibase');
Emojibase is primarily an ESM package since v16. Use `import` syntax. `getEmojiData` is a common utility to retrieve emoji datasets.
getEmojiRegex
import { getEmojiRegex } from 'emojibase-regex';
import { getEmojiRegex } from 'emojibase';
Emoji regex utilities are provided by the separate `emojibase-regex` package, not the core `emojibase` package itself. Ensure you install and import from the correct package.
Emoji
import type { Emoji } from 'emojibase';
Type import for the Emoji interface when working with TypeScript.

Demonstrates fetching all emoji data, finding a specific emoji, and using the emoji regular expression to match emojis within a string.

import { getEmojiData } from 'emojibase'; import { getEmojiRegex } from 'emojibase-regex'; async function processEmojis() { // Fetch all emoji data, defaulting to English const allEmojis = await getEmojiData('en'); console.log(`Total emojis: ${allEmojis.length}`); // Find a specific emoji by hex code (e.g., grinning face) const grinningFace = allEmojis.find(emoji => emoji.hexcode === '1F600'); if (grinningFace) { console.log(`Found emoji: ${grinningFace.emoji} - ${grinningFace.label}`); } // Get a regex that matches all known emojis const emojiRegex = getEmojiRegex(); const text = "Hello world! 👋 This is an example with some emojis: 😂👍🌍."; const matchedEmojis = text.match(emojiRegex); if (matchedEmojis) { console.log(` Emojis found in text: ${matchedEmojis.join(', ')}`); } // You can also filter based on properties like 'skins' const skinToneEmojis = allEmojis.filter(emoji => emoji.skins && emoji.skins.length > 0); console.log(` Emojis with skin tones: ${skinToneEmojis.slice(0, 5).map(e => e.emoji).join(', ')}...`); } processEmojis().catch(console.error);
Debug
Known issues
breakingEmojibase v17.0.0 updates its internal data to the latest Emoji v17 and CLDR 48 specifications. While mostly backwards compatible, changes in emoji properties or the introduction/removal of certain emojis might affect applications relying on specific data points or subset IDs.
fix
Review your emoji processing logic to ensure compatibility with Emoji v17 and CLDR 48. Test any filtering or lookup mechanisms against the new dataset.
affects: >=17.0.0
breakingVersion 16.0.0 of Emojibase dropped support for Node.js v16. Projects must now run on Node.js v18.12.0 or higher.
fix
Upgrade your Node.js environment to version 18.12.0 or newer. Ensure your CI/CD pipelines and deployment environments are also updated.
affects: >=16.0.0
breakingEmojibase has transitioned to an ESM-first package, particularly since v16. While CJS might still function in some setups, direct `require()` calls for modern features or in pure ESM projects may fail.
fix
Prefer `import` statements for Emojibase modules. If you are in a CommonJS environment, consider configuring your project for hybrid ESM/CJS or using dynamic `import()` for Emojibase.
affects: >=16.0.0
Errors
Common errors & fixes
SyntaxError: Cannot use import statement outside a module
Attempting to use ES module `import` syntax in a CommonJS (CJS) file or environment without proper transpilation or configuration.
fix
Ensure your `package.json` includes `"type": "module"` if you are writing an ESM project. If you must use CommonJS, use dynamic `import('emojibase')` or configure a bundler like Webpack/Rollup to handle ESM imports.
Error: Emojibase requires Node.js v18.12.0 or higher.
Running Emojibase v16 or newer on an unsupported Node.js version (e.g., v16 or older).
fix
Update your Node.js installation to version 18.12.0 or newer to meet the minimum engine requirements for Emojibase.
TypeError: Cannot read properties of undefined (reading 'find')
Trying to access methods on an undefined emoji dataset, potentially due to incorrect import paths or a failed data load.
fix
Verify that `getEmojiData` is correctly imported and awaited, and that the returned data is not `null` or `undefined`. Check for any network issues if loading data remotely, or ensure `emojibase-data` is properly installed if using local data files.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
emojibase — npm install emojibase · libregistry