Registry / serialization / wemoji

wemoji

JSON →
library1.0.1jsnpmunverified

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.

npm install wemoji
INSTALL
IMPORT
SIG · WEMOJI
W
wemoji
serializationjavascriptv1.0.1
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.

wemoji
const wemoji = require('wemoji');
import wemoji from 'wemoji';
wemoji is primarily designed for CommonJS environments. Native ES module imports are not supported without a bundler configured for CJS interop.
wemoji.name
const dragonEmoji = wemoji.name['dragon'];
import { name } from 'wemoji';
The `name` property is an object mapping short names to emoji data. It is accessed directly from the default CommonJS export of the package.
wemoji.unicode
const loveHotelEmoji = wemoji.unicode['🏩'];
import { unicode } from 'wemoji';
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.

Demonstrates how to import `wemoji` using CommonJS and retrieve emoji data by both short name and Unicode character.

const wemoji = require('wemoji'); // Access emoji data by short name const dragonEmoji = wemoji.name['dragon']; console.log('Dragon Emoji Data:', dragonEmoji); /* Yields: { emoji: '🐉', platforms: [ 'tw', 'a', 'g' ], description: 'DRAGON', name: 'dragon', css: 'dragon', category: 'animal' } */ // Access emoji data by unicode character const loveHotelEmoji = wemoji.unicode['🏩']; console.log('Love Hotel Emoji Data:', loveHotelEmoji); /* Yields: { emoji: '🏩', platforms: [ 'tw', 'a', 'g' ], description: 'LOVE HOTEL', name: 'love_hotel', css: 'love_hotel', category: 'travel' } */
Debug
Known issues
breakingThe 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.
fix
Consider migrating to alternative, actively maintained emoji libraries that support recent Unicode versions (e.g., `emoji-datasource`, `emojibase`).
affects: >=1.0.0
gotchawemoji 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.
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.
affects: >=1.0.0
deprecatedFront-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.
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.
affects: >=1.0.0
gotchaThe `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.
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.
affects: >=1.0.0
Errors
Common errors & fixes
ReferenceError: require is not defined in ES module scope
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.
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.
TypeError: Cannot read properties of undefined (reading 'dragon')
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.
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.
Emoji images are not appearing, or only text descriptions are shown.
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.
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.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
18 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources