DEmojiJS is a lightweight, simple NodeJS wrapper around the DiscordEmoji API.
Last updated 2 years ago by jinzulen .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install demojijs 
SYNC missed versions from official npm registry.


DiscordEmoji's number one API client for Node-based applications.

CodeFactor NPM Version NPM Weekly Downloads

1. Installation

DEmojiJS is trusted by hundreds of users from all over to power their interactions with the DiscordEmoji API. Why? It's faster thanks to its caching features, its wide array of versatile search functionalities and overall stable performance. Not convinced?

See for yourself:

If you are running a version older than v1.3.4, please update as soon as possible.

npm i demojijs@latest

1.2 Nodemon

It is possible for Nodemon users to encounter problems when adding DEmojiJS to their project, this is due to the wrapper's caching mechanism, which initializes a JSON cache store on startup, this act causes a never-ending loop where Nodemon keeps detecting a ".json" change, thereby restarting the app, which in turn causes the cache handler to yet again initialize the store, etc...

This can be easily avoided by checking that you are running the latest DEmojiJS version (look at the NPM version badge above) and then simply adding DiscordEmoji.json to the list of ignored files in the Nodemon config, like so:

"ignore": "DiscordEmoji.json"

Please refer yourself to this section of the public Nodemon repository if you don't know how to configure Nodemon.

2. Usage Examples

Often times, you won't be able to fetch a recently uploaded emote, this is not a fault of DEmojiJS; the data provided by DiscordEmoji themselves through their API is often outdated by a month or two, give or take. Most of the time, entire chunks of emotes are missing given the API doesn't serve every emote in DiscordEmoji's database.

Firstly, require DEmojiJS:

const Emoji = require("demojijs");

2.1 Packs

  • Grabbing all packs.
Emoji.Packs().then(Packs => {
    console.log(`Found ${Packs.length} packs.`);

    Packs.forEach(function(Pack) {
        console.log(`- #${} ${} has ${Pack.amount} emotes and can be downloaded here: ${}`);
// Found 8 packs.
// - #9 Pensive Emojis has 8 emotes and can be downloaded here:
// - #8 Original Remixes #1 has 12 emotes and can be downloaded here:
// - #7 Blob Pack #1 has 16 emotes and can be downloaded here:
// - #6 100 Remixes has 12 emotes and can be downloaded here: #5 PUBG Pack has 10 emotes and can be downloaded here:
// - #4 Minecraft Pack has 16 emotes and can be downloaded here:
// - #3 Pepe Pack #1 has 16 emotes and can be downloaded here:
// - #2 Anime Pack #1 has 16 emotes and can be downloaded here:
  • Grabbing a pack by ID, title or slug.

Input is not case-sensitive.

Emoji.Packs("minecraft pack").then(console.log).catch(console.error);

2.2 Emotes & Stats

  • Grabbing DiscordEmoji's statistics.
// Grab all statistics.
Emoji.Statistics().then(Data => {
    console.log(`DiscordEmoji has ${Data.emoji} emojis, ${Data.users} users, ${Data.faves} favorited emojis and ${Data.pending_approvals} emojis pending approval.`);
// DiscordEmoji has 15660 emojis, 126446 users, 103646 favorited emojis and 17 emojis pending approval.

// Grab individual statistics.
// For reference on the currently available search parameters, visit:
// If you only want one parameter, make sure to keep it as an array rather than a string: Statistics(["users"]) not Statistics("users")
Emoji.Statistics(["users", "faves"]).then(console.log).catch(console.error);
// { users: 126468, faves: 103702 }
  • Grabbing a random emote.
// Grab a random emote.

// Grab a random animated (GIF) emote by simply setting "true" as the sole argument.

// Grab a random emote from a specific category by simply setting the name of the category as the sole argument.
  • Grabbing all emotes.

Keep in mind that this will return an array if you choose to return GIFs only.

// Grab everything.

// Grab only animated (GIF) emotes by simply setting "true" as the sole argument.
Emoji.allEmoji(true).then(Emotes => console.log(`${Emotes.length} animated emotes found.`)).catch(console.error);
  • Grabbing an emote by ID.
  • Grabbing an emote by title.

Emote title is not case sensitive.

  • Grabbing an emote by category.

Keep in mind that this will return an array and that the input is not case-sensitive.

For reference on all the available categories, visit:

Emoji.emojiByCategory("anime").then(Emotes => console.log(`Found ${Emotes.length} emotes in this category.`)).catch(console.error);
// Found 1090 emotes in this category.
  • Grabbing an emote by its slug.
Emoji.emojiBySlug("5263_flashthink").then(Emote => {
    console.log(`${Emote.title}, uploaded by ${Emote.submitted_by}. => ${Emote.image}`)
// flashthink, uploaded by Jin. =>
  • Grabbing emotes by author.

Keep in mind that this will return an array; also, the uploader name is not case sensitive.

  1. Grab all of the user's emotes.

    Emoji.emojiByAuthor("Jin").then(Emotes => {
        console.log(`This user has uploaded ${Emotes.length} emotes; here are a couple of them:`);
        Emotes.slice(-2).forEach(function(Emote) {
            console.log(`${Emote.title} => ${Emote.image}`);
    // This user has uploaded 90 emotes; here are a couple of them:
    // linkdab =>
    // KappaYugi =>
  2. Grab all of the user's animated (GIF) emotes.

    // Simply set "true" as the second argument.
    Emoji.emojiByAuthor("Jin", true).then(Emotes => {
        console.log(`This user has uploaded ${Emotes.length} animated emotes; for example:`);
        Emotes.slice(-2).forEach(function(Emote) {
            console.log(`${Emote.title} => ${Emote.image}`);
    // This user has uploaded 7 animated emotes; for example:
    // linkwut =>
    // linklurk =>
  • Grabbing emotes by license.

Keep in mind that this will return an array and that the input is not case-sensitive.

Emoji.emojiByLicense("basic").then(Emotes => console.log(`Found ${Emotes.length} emotes.`)).catch(console.error);
Emoji.emojiByLicense("wtfpl").then(Emotes => console.log(`Found ${Emotes.length} emotes.`)).catch(console.error);
Emoji.emojiByLicense("cc by 4.0").then(Emotes => console.log(`Found ${Emotes.length} emotes.`)).catch(console.error);
// Found 5108 emotes.
// Found 83 emotes.
// Found 254 emotes.

// Grab animted (GIF) emotes under a certain license by setting "true" as the second argument.
Emoji.emojiByLicense("basic", true).then(Emotes => console.log(`Found ${Emotes.length} animated emotes.`)).catch(console.error);
Emoji.emojiByLicense("wtfpl", true).then(Emotes => console.log(`Found ${Emotes.length} animated emotes.`)).catch(console.error);
Emoji.emojiByLicense("cc by 4.0", true).then(Emotes => console.log(`Found ${Emotes.length} animted emotes.`)).catch(console.error);
// Found 649 animated emotes.
// Found 12 animated emotes.
// Found 36 animted emotes.

3. License

This module is publisher under the Apache 2.0 license.

Current Tags

  • 1.3.5                                ...           latest (5 months ago)

12 Versions

  • 1.3.5                                ...           5 months ago
  • 1.3.4                                ...           5 months ago
  • 1.3.3                                ...           5 months ago
  • 1.3.2                                ...           5 months ago
  • 1.3.1                                ...           5 months ago
  • 1.2.0                                ...           2 years ago
  • 1.0.9                                ...           2 years ago
  • 1.0.8                                ...           2 years ago
  • 1.0.7                                ...           2 years ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (0)
Dependents (1)

Copyright 2014 - 2017 © |