title: Twemoji parse string and change emojis to code equivalent
body: <p>I am using this library <a href="https://www.npmjs.com/package/twemoji" rel="nofollow noreferrer">https://www.npmjs.com/package/twemoji</a> and can't figure out how to convert string like this </p>
  
  <pre><code>'I \u2764\uFE0F emoji!'
  </code></pre>
  
  <p>not to </p>
  
  <pre><code>I &lt;img class="emoji" draggable="false" alt="❤️" src="/assets/36x36/2764.gif"&gt; emoji!
  </code></pre>
  
  <p>but to </p>
  
  <pre><code>I :2764: emoji!
  </code></pre>
  
  <p>i've tried their twemoji.convert.toCodePoint() helper, tried it like this</p>
  
  <pre><code>twemoji.convert.toCodePoint('I \u2764\uFE0F emoji!');
  </code></pre>
  
  <p>but result is</p>
  
  <pre><code>49-20-2764-fe0f-20-65-6d-6f-6a-69-21
  </code></pre>
  
  <p>it have needed part (2764), but also converted all letters too. So i need like a regexp to find an emoji in text, but all i find is </p>
  
  <pre><code>var ranges = [
    '\ud83c[\udf00-\udfff]', // U+1F300 to U+1F3FF
    '\ud83d[\udc00-\ude4f]', // U+1F400 to U+1F64F
    '\ud83d[\ude80-\udeff]'  // U+1F680 to U+1F6FF
  ];
  </code></pre>
  
  <p>from here <a href="http://crocodillon.com/blog/parsing-emoji-unicode-in-javascript" rel="nofollow noreferrer">http://crocodillon.com/blog/parsing-emoji-unicode-in-javascript</a> but it doesn't covers all of emojies (no flags for example)</p>