UNPKG

emojic

Version:

Emoji in your Node.js command line apps.

28 lines (22 loc) 635 B
"use strict"; var emojisPath = require.resolve("emojilib/emojis.json"), rJson = require("r-json"), camelo = require("camelo"), iterateObject = require("iterate-object"); var emojis = rJson(emojisPath); // Export the emojic object var emojic = module.exports = {}; // Append the chars to it iterateObject(emojis, function (value, name) { switch (name) { case "+1": name = "thumbs-up"; break; case "-1": name = "thumbs-down"; break; } emojic[camelo(name)] = process.platform === "win32" ? "" : value.char; }); // Free the memory emojis = null;