{"id":10788,"library":"emojibase","title":"Emojibase","description":"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.","status":"active","version":"17.0.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/milesj/emojibase","tags":["javascript","emoji","emojibase","data","regex","helper","loader","cdn","typescript"],"install":[{"cmd":"npm install emojibase","lang":"bash","label":"npm"},{"cmd":"yarn add emojibase","lang":"bash","label":"yarn"},{"cmd":"pnpm add emojibase","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Emojibase is primarily an ESM package since v16. Use `import` syntax. `getEmojiData` is a common utility to retrieve emoji datasets.","wrong":"const { getEmojiData } = require('emojibase');","symbol":"getEmojiData","correct":"import { getEmojiData } from 'emojibase';"},{"note":"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.","wrong":"import { getEmojiRegex } from 'emojibase';","symbol":"getEmojiRegex","correct":"import { getEmojiRegex } from 'emojibase-regex';"},{"note":"Type import for the Emoji interface when working with TypeScript.","symbol":"Emoji","correct":"import type { Emoji } from 'emojibase';"}],"quickstart":{"code":"import { getEmojiData } from 'emojibase';\nimport { getEmojiRegex } from 'emojibase-regex';\n\nasync function processEmojis() {\n  // Fetch all emoji data, defaulting to English\n  const allEmojis = await getEmojiData('en');\n  console.log(`Total emojis: ${allEmojis.length}`);\n\n  // Find a specific emoji by hex code (e.g., grinning face)\n  const grinningFace = allEmojis.find(emoji => emoji.hexcode === '1F600');\n  if (grinningFace) {\n    console.log(`Found emoji: ${grinningFace.emoji} - ${grinningFace.label}`);\n  }\n\n  // Get a regex that matches all known emojis\n  const emojiRegex = getEmojiRegex();\n  const text = \"Hello world! 👋 This is an example with some emojis: 😂👍🌍.\";\n  const matchedEmojis = text.match(emojiRegex);\n\n  if (matchedEmojis) {\n    console.log(`\nEmojis found in text: ${matchedEmojis.join(', ')}`);\n  }\n\n  // You can also filter based on properties like 'skins'\n  const skinToneEmojis = allEmojis.filter(emoji => emoji.skins && emoji.skins.length > 0);\n  console.log(`\nEmojis with skin tones: ${skinToneEmojis.slice(0, 5).map(e => e.emoji).join(', ')}...`);\n}\n\nprocessEmojis().catch(console.error);\n","lang":"typescript","description":"Demonstrates fetching all emoji data, finding a specific emoji, and using the emoji regular expression to match emojis within a string."},"warnings":[{"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.","message":"Emojibase 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.","severity":"breaking","affected_versions":">=17.0.0"},{"fix":"Upgrade your Node.js environment to version 18.12.0 or newer. Ensure your CI/CD pipelines and deployment environments are also updated.","message":"Version 16.0.0 of Emojibase dropped support for Node.js v16. Projects must now run on Node.js v18.12.0 or higher.","severity":"breaking","affected_versions":">=16.0.0"},{"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.","message":"Emojibase 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.","severity":"breaking","affected_versions":">=16.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"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.","cause":"Attempting to use ES module `import` syntax in a CommonJS (CJS) file or environment without proper transpilation or configuration.","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Update your Node.js installation to version 18.12.0 or newer to meet the minimum engine requirements for Emojibase.","cause":"Running Emojibase v16 or newer on an unsupported Node.js version (e.g., v16 or older).","error":"Error: Emojibase requires Node.js v18.12.0 or higher."},{"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.","cause":"Trying to access methods on an undefined emoji dataset, potentially due to incorrect import paths or a failed data load.","error":"TypeError: Cannot read properties of undefined (reading 'find')"}],"ecosystem":"npm"}