is-emoji

0.1.1 • Public • Published

is-emoji Build Status

Simple enough:

var isEmoji = require('is-emoji');
 
isEmoji('🌻'); // true
isEmoji('🌻'); // true
 
// for string iteration, since emoji char will be broken up over two indexes.
var str = 'abc🚲def';
 
for (var i = 0; i < str.length; i++) {
  var s = str[i];
  // will be true for i == 3, which will tell you
  if (isEmoji.isFirstCharCode(s.charCodeAt(0))) {
    // the character is 4 bytes, so concatenate them
    s += str[i+1];
  }
 
  console.log(s);
}
 

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    329
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    329
  • 0.1.0
    0
  • 0.0.0
    0

Package Sidebar

Install

npm i is-emoji

Weekly Downloads

329

Version

0.1.1

License

MIT

Last publish

Collaborators

  • smurthas