{"id":16582,"library":"wemoji","title":"wemoji: Universal Emoji Database","description":"wemoji is a JavaScript library providing a universal emoji database, designed as a near drop-in replacement for `gemoji`. Currently at version `1.0.1`, the project appears to have an infrequent release cadence, with the last significant activity dating back to 2016. Its primary differentiators include a dataset reported to be superior to `gemoji`, and a comprehensive set of perfectly matched CSS and emoji picker assets for consistent visual display across various platforms (Apple, Google, Twitter styles). It is built upon the `emoji-data` project and aims to provide harmony between front-end and back-end emoji rendering, although its asset management relies on older tools like Bower and manual file copying.","status":"abandoned","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/wedgies/wemoji","tags":["javascript","emoji","gemoji"],"install":[{"cmd":"npm install wemoji","lang":"bash","label":"npm"},{"cmd":"yarn add wemoji","lang":"bash","label":"yarn"},{"cmd":"pnpm add wemoji","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"wemoji is primarily designed for CommonJS environments. Native ES module imports are not supported without a bundler configured for CJS interop.","wrong":"import wemoji from 'wemoji';","symbol":"wemoji","correct":"const wemoji = require('wemoji');"},{"note":"The `name` property is an object mapping short names to emoji data. It is accessed directly from the default CommonJS export of the package.","wrong":"import { name } from 'wemoji';","symbol":"wemoji.name","correct":"const dragonEmoji = wemoji.name['dragon'];"},{"note":"The `unicode` property is an object mapping Unicode emoji characters to their data. It is accessed directly from the default CommonJS export of the package.","wrong":"import { unicode } from 'wemoji';","symbol":"wemoji.unicode","correct":"const loveHotelEmoji = wemoji.unicode['🏩'];"}],"quickstart":{"code":"const wemoji = require('wemoji');\n\n// Access emoji data by short name\nconst dragonEmoji = wemoji.name['dragon'];\nconsole.log('Dragon Emoji Data:', dragonEmoji);\n/*\nYields:\n{\n  emoji: '🐉',\n  platforms: [ 'tw', 'a', 'g' ],\n  description: 'DRAGON',\n  name: 'dragon',\n  css: 'dragon',\n  category: 'animal'\n}\n*/\n\n// Access emoji data by unicode character\nconst loveHotelEmoji = wemoji.unicode['🏩'];\nconsole.log('Love Hotel Emoji Data:', loveHotelEmoji);\n/*\nYields:\n{\n  emoji: '🏩',\n  platforms: [ 'tw', 'a', 'g' ],\n  description: 'LOVE HOTEL',\n  name: 'love_hotel',\n  css: 'love_hotel',\n  category: 'travel'\n}\n*/","lang":"javascript","description":"Demonstrates how to import `wemoji` using CommonJS and retrieve emoji data by both short name and Unicode character."},"warnings":[{"fix":"Consider migrating to alternative, actively maintained emoji libraries that support recent Unicode versions (e.g., `emoji-datasource`, `emojibase`).","message":"The wemoji project is abandoned; its last significant commit was in 2016. This means the emoji database is severely outdated and will not include newer Unicode emoji beyond version 9.0. There will be no security updates, bug fixes, or new feature development.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"For Node.js environments, use `const wemoji = require('wemoji');`. For browser use in modern projects, rely on a bundler or consider using a different, ESM-compatible emoji library.","message":"wemoji is primarily designed for CommonJS environments. Attempting to use native ES module `import` syntax will result in errors (e.g., 'require is not defined') unless a bundler (like Webpack or Rollup) is specifically configured for CommonJS interop.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Manually retrieve the necessary CSS and image files from the `wemoji` GitHub repository's `dist` folder or the `emoji-data` project. Ensure correct paths are configured in your application's CSS and asset pipeline.","message":"Front-end assets (CSS and images for different platform styles) are recommended to be installed via `bower`, which is a largely deprecated package manager. The manual asset management process detailed in the README (copying from `emoji-data` submodule) is cumbersome and error-prone.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Ensure you have correctly installed or copied the `wemoji` CSS files and the corresponding emoji image assets (from `emoji-data`) into your project. Link the chosen platform-specific CSS (e.g., `wemoji-tw.css`) in your HTML to enable visual emoji rendering.","message":"The `platforms` array (e.g., `tw`, `a`, `g`) in emoji data refers to Twitter, Apple, and Google emoji styles. Displaying these requires corresponding CSS files (e.g., `wemoji-tw.css`) and image assets, which are not included in the main `wemoji` npm package and must be installed/managed separately.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-22T00:00:00.000Z","next_check":"2026-07-21T00:00:00.000Z","problems":[{"fix":"Either convert your file to CommonJS (`.js` extension without `\"type\": \"module\"`) or use a bundler (like Webpack or Rollup) configured to handle CommonJS modules within an ES module project.","cause":"Attempting to use `require()` in a JavaScript file that is treated as an ES module (e.g., by having `\"type\": \"module\"` in `package.json` or a `.mjs` extension) for a CommonJS-only library.","error":"ReferenceError: require is not defined in ES module scope"},{"fix":"Verify that `wemoji` is correctly installed (`npm install wemoji`) and that `const wemoji = require('wemoji');` successfully retrieves the package's exports. Ensure you are accessing `wemoji.name` or `wemoji.unicode` after the `wemoji` object has been loaded.","cause":"The `wemoji` object or its nested properties (`name`, `unicode`) were not correctly loaded or are undefined, often due to an incorrect `require` or `import` statement, or the package not being installed.","error":"TypeError: Cannot read properties of undefined (reading 'dragon')"},{"fix":"Manually copy the CSS and image assets from the `wemoji` GitHub repository's `dist` folder or the `emoji-data` project. Ensure the CSS files are included in your HTML and that the image paths specified within the CSS are correct and accessible.","cause":"The necessary front-end CSS files (e.g., `wemoji-tw.css`) and their corresponding image assets are missing, not correctly linked, or their paths are misconfigured.","error":"Emoji images are not appearing, or only text descriptions are shown."}],"ecosystem":"npm"}