npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

exuemoji

v2.12.1

Published

Complete Node.js port of the Python emoji library - convert emoji names to unicode and vice versa

Readme

exuemoji

Complete Node.js port of the Python emoji library v2.12.1
Convert emoji names to unicode and vice versa. Supports 14 languages + aliases.

Installation

npm install exuemoji

Quick Start

import { emojize, demojize, emojiList, isEmoji } from 'exuemoji';

// Convert emoji names to unicode
emojize('Python is fun :thumbs_up:');  // 'Python is fun 👍'

// Convert unicode to shortcodes
demojize('Python is fun 👍');           // 'Python is fun :thumbs_up:'

// List all emoji in a string
emojiList('Hi 😁');  // [{ emoji: '😁', match_start: 3, match_end: 4 }]

// Check if a string is a single emoji
isEmoji('👍');  // true

API Reference

emojize(string, delimiters, variant, language, version, handleVersion)

Replace emoji names (:name:) with unicode characters.

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | string | string | required | Input string with emoji names | | delimiters | [string, string] | [':', ':'] | Opening/closing delimiters | | variant | string\|null | null | 'text_type', 'emoji_type', or null | | language | string | 'en' | Language code or 'alias' | | version | number\|null | null | Max emoji version | | handleVersion | string\|Function\|null | null | Handler for emoji above version |

emojize('Hello :thumbs_up:');                              // 'Hello 👍'
emojize('Hello {thumbs_up}', ['{', '}']);                  // 'Hello 👍'
emojize('Hello :+1:', [':', ':'], null, 'alias');          // 'Hello 👍'
emojize(':red_heart:', [':', ':'], 'emoji_type');          // '❤️'
emojize(':thumbs_up:', [':', ':'], null, 'en', 0.5, '');  // '' (filtered out)

demojize(string, delimiters, language, version, handleVersion)

Replace unicode emoji with shortcodes.

demojize('Hello 👍');                          // 'Hello :thumbs_up:'
demojize('Hello 👍', ['__', '__']);            // 'Hello __thumbs_up__'
demojize('Hello 👍', [':', ':'], 'de');        // 'Hello :Daumen_hoch:'
demojize('Hello 👍', [':', ':'], 'alias');     // 'Hello :+1:'

analyze(string, nonEmoji, joinEmoji)

Analyze a string and yield tokens for each character/emoji found.

import { analyze, EmojiMatch } from 'exuemoji';

for (const token of analyze('a👍b', true)) {
  if (token.value instanceof EmojiMatch) {
    console.log('Found emoji:', token.value.emoji);
  } else {
    console.log('Found char:', token.value);
  }
}

replaceEmoji(string, replace, version)

Replace emoji with custom strings.

replaceEmoji('Hello 👍 😁', '[emoji]');           // 'Hello [emoji] [emoji]'
replaceEmoji('Hello 👍', (emj, data) => data.en);  // 'Hello :thumbs_up:'
replaceEmoji('Hello 👍', '', 0.5);                  // 'Hello ' (only old emoji)

emojiList(string)

Get all emoji in a string with their positions.

emojiList('Hi 😁 there 👍');
// [
//   { emoji: '😁', match_start: 3, match_end: 4 },
//   { emoji: '👍', match_start: 12, match_end: 13 }
// ]

distinctEmojiList(string)

Get unique emoji from a string.

distinctEmojiList('👍 👍 👍 😁');  // ['👍', '😁']

emojiCount(string, unique)

Count emoji in a string.

emojiCount('👍 👍 👍');       // 3
emojiCount('👍 👍 👍', true);  // 1

isEmoji(string)

Check if a string is exactly one RGI emoji.

isEmoji('👍');     // true
isEmoji('hello');  // false

purelyEmoji(string)

Check if a string contains only emoji (no regular text).

purelyEmoji('👍😁');     // true
purelyEmoji('👍 hello');  // false

version(string)

Get the Emoji Version of an emoji.

version('😁');        // 0.6
version('👍');        // 0.6
version(':butter:');  // 3.0

Supported Languages

| Code | Language | |------|----------| | en | English | | es | Spanish | | ja | Japanese | | ko | Korean | | pt | Portuguese | | it | Italian | | fr | French | | de | German | | fa | Persian | | id | Indonesian | | zh | Chinese | | ru | Russian | | tr | Turkish | | ar | Arabic | | alias | English aliases (:+1:, etc.) |

Configuration

import { config } from 'exuemoji';

// Keep ZWJ sequences in demojize()
config.demojizeKeepZwj = true;    // default

// Keep ZWJ sequences in replaceEmoji()
config.replaceEmojiKeepZwj = false;  // default

Building a Bot? See examples/bot-example.js

import { emojize, demojize, isEmoji, emojiCount } from 'exuemoji';

// Discord/Telegram bot example
function processMessage(message) {
  // Convert :name: to emoji
  const withEmoji = emojize(message);

  // Check if message is just emoji
  if (isEmoji(message)) {
    return `You sent a single emoji: ${message}`;
  }

  // Count emoji usage
  const count = emojiCount(message);
  if (count > 5) {
    return `Wow, you used ${count} emoji!`;
  }

  return withEmoji;
}

License

BSD-3-Clause (same as original Python emoji library)