How to use the emoji-js.EmojiConvertor function in emoji-js

To help you get started, we’ve selected a few emoji-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eramdam / BetterTweetDeck / tools / update_emojis.js View on Github external
const needle = require('needle');
const _ = require('lodash');
const jsEmoji = require('emoji-js');
const fs = require('fs');

const Emoji = new jsEmoji.EmojiConvertor();
Emoji.img_set = 'twitter';

function getUnified(emoji) {
  Emoji.replace_mode = 'unified';

  const converted = Emoji.replace_colons(`:${emoji.s[0]}:`);

  if (!converted.startsWith(':') && !converted.startsWith('
github raphox / slack-history / scripts / generate-session-object.js View on Github external
synonymous: HIGHLIGHT_TERMS.find((item) => item[0] === v)
          };
          return a;
        }, {});

      jsonfile.writeFileSync(destination_path, obj, { spaces: 2 });
    });
  } else {
    console.log("Error: File in 'path' not found.");
  }
}

/**
 * Convert markdown message to HTML
 */
const emojiConvertor = new emoji.EmojiConvertor();
emojiConvertor.replace_mode = 'unified';
emojiConvertor.allow_native = true;
const convertMessage = (message) => emojiConvertor.replace_colons(marked(message.trim()));

/**
 * Process the message and count the times a important word occurs
 *
 * @param {string} message
 * @param {object} highlights
 */
const highlightTerms = (message, highlights = {}) => {
  let collection = {};

  for (let synonymous of HIGHLIGHT_TERMS) {
    let count = highlights[synonymous[0]] || 0;
github eramdam / BetterTweetDeck / src / js / util / emojis.js View on Github external
import jsEmoji from 'emoji-js';
import { sortBy } from 'lodash';
import emojis from '../../emojis/emojis';
import { $ } from './util';

const Emoji = new jsEmoji.EmojiConvertor();
const emojiSheet = chrome.extension.getURL('emojis/sheet_twitter_64.png');
Emoji.img_set = 'twitter';

const catOrder = {
  'Smileys & People': -80,
  'Animals & Nature': -70,
  'Food & Drink': -60,
  Activities: -50,
  'Travel & Places': -40,
  Objects: -30,
  Symbols: -20,
  Flags: -10,
};

const catNames = Object.keys(catOrder);
github eramdam / BetterTweetDeck / src / js / util / emojis / emojiUtils.js View on Github external
import jsEmoji from 'emoji-js';
import { sortBy } from 'lodash';

import emojis from '../../../emojis/emojis';
import { getExtensionUrl } from '../browserHelper';

const Emoji = new jsEmoji.EmojiConvertor();

const emojiSheet = getExtensionUrl('emojis/sheet_twitter_64.png');
Emoji.img_set = 'twitter';

export const colonRegex = /:([a-z0-9_\-+]+):?:?([a-z0-9_-]+)?:?$/;

const catOrder = {
  'Smileys & People': -80,
  'Animals & Nature': -70,
  'Food & Drink': -60,
  Activities: -50,
  'Travel & Places': -40,
  Objects: -30,
  Symbols: -20,
  Flags: -10,
};

emoji-js

A JS Emoji conversion library

MIT
Latest version published 12 months ago

Package Health Score

69 / 100
Full package analysis

Popular emoji-js functions