Giter Site home page Giter Site logo

emoji-data-js's Introduction

emoji-data-js

NodeJS library providing low level operations for dealing with Emoji glyphs in the Unicode standard. ๐Ÿ†’

EmojiData.js is like a swiss-army knife for dealing with Emoji encoding issues. If all you need to do is translate :poop: into ๐Ÿ’ฉ, then there are plenty of other libs out there that will probably do what you want. But once you are dealing with Emoji as a fundamental part of your application, and you start to realize the nightmare of doublebyte encoding or variants, then this library may be your new best friend. :raised_hands:

EmojiData.js is written by the same author as the Ruby emoji_data.rb gem, which is used in production by Emojitracker.com to parse well over 100M+ emoji glyphs daily. This version was written to provide all the same functionality while taking advantage of the crazy speed of the V8 runtime environment. ๐Ÿ’ซ

Build Status

Installation

npm install emoji-data

Usage Examples

> var EmojiData = require('emoji-data');

> EmojiData.from_unified('2665');
{ name: 'BLACK HEART SUIT',
  unified: '2665',
  variations: [ '2665-FE0F' ],
  docomo: 'E68D',
  au: 'EAA5',
  softbank: 'E20C',
  google: 'FEB1A',
  short_name: 'hearts',
  short_names: [ 'hearts' ],
  text: null,
  apple_img: true,
  hangouts_img: true,
  twitter_img: true }

> EmojiData.all().length
845

> EmojiData.all_with_variants().length
107

> EmojiData.find_by_short_name("moon").length
13

> EmojiData.find_by_name("tree").map(
    function(c) { return [c.unified, c.render(), c.name]; }
  );
[ [ '1F332', '๐ŸŒฒ', 'EVERGREEN TREE' ],
  [ '1F333', '๐ŸŒณ', 'DECIDUOUS TREE' ],
  [ '1F334', '๐ŸŒด', 'PALM TREE' ],
  [ '1F384', '๐ŸŽ„', 'CHRISTMAS TREE' ],
  [ '1F38B', '๐ŸŽ‹', 'TANABATA TREE' ] ]

> EmojiData.scan("I โ™ฅ when marketers talk about the โ˜. #blessed").forEach(
    function(ec) { console.log("Found some " + ec.short_name + "!"); }
  );
Found some hearts!
Found some cloud!

API Documentation

http://coffeedoc.info/github/mroth/emoji-data-js/master/

Contributing

Please be sure to run npm test and help keep test coverage at ๐Ÿ’ฏ.

There is a full benchmark suite available via npm run-script bench. Please test before and after your changes to ensure you have not caused a performance regression.

License

The MIT License (MIT)

emoji-data-js's People

Contributors

mroth avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.