orionsoft-react-scripts
Version:
Orionsoft Configuration and scripts for Create React App.
42 lines (28 loc) • 3.04 kB
Markdown
# node-emoji
[](https://www.npmjs.com/package/node-emoji) [](https://www.npmjs.com/package/node-emoji) [](https://travis-ci.org/omnidan/node-emoji) [](https://david-dm.org/omnidan/node-emoji) [](https://codeclimate.com/github/omnidan/node-emoji) [](https://paypal.me/DanielBugl/10) [](https://gratipay.com/~omnidan/)
_simple emoji support for node.js projects_

## Installation
To install `node-emoji`, you need [node.js](http://nodejs.org/) and [npm](https://github.com/npm/npm#super-easy-install). :rocket:
Once you have that set-up, just run `npm install --save node-emoji` in your project directory. :ship:
You're now ready to use emoji in your node projects! Awesome! :metal:
## Usage
```javascript
var emoji = require('node-emoji');
console.log(emoji.get('coffee')); // returns the emoji code for coffee (displays emoji on terminals that support it)
console.log(emoji.which(emoji.get('coffee'))); // returns the string "coffee"
console.log(emoji.get(':fast_forward:')); // `.get` also supports github flavored markdown emoji (http://www.emoji-cheat-sheet.com/)
console.log(emoji.emojify('I :heart: :coffee:!')); // replaces all :emoji: with the actual emoji, in this case: returns "I ❤️ ☕️!"
```
## Adding new emoji
Emoji come from js-emoji (Thanks a lot :thumbsup:). You can get a JSON file with all emoji here: https://github.com/omnidan/node-emoji/blob/master/lib/emoji.json
To update the list or add custom emoji, clone this repository and put them into `lib/emojifile.js`.
Then run `npm run-script emojiparse` in the project directory or `node emojiparse` in the lib directory.
This should generate the new emoji.json file and output `Done.`.
That's all, you now have more emoji you can use! :clap:
## Support / Donations
If you want to support node-emoji development, please consider donating (it helps me keeping my projects active and alive!):
* Paypal: [](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YBMS9EKTNPZHJ)
* Gratipay: [](https://gratipay.com/omnidan/)
* Bitcoin: 114veSsYoyw2QrXkPTxHD51B5i39TinsBP
