emoji-autocomplete

0.1.2 • Public • Published

Emoji Autocomplete

npm version dependencies

📇 A small Node Library with zero production dependencies, turning words into emojis (turn rent into 🏠 💸). The API is quite simple:

Find Emoji using a search term

var autocomplete = require('emoji-autocomplete');
 
var matchedEmoji = autocomplete.match('rent');

The result will be:

[ComplexEmoji {
    name: 'rent',
    emoji: '🏠💸',
    isComplex: true,
    content: [
        Emoji { name: 'house', emoji: '🏠' },
        Emoji { name: 'money_with_wings', emoji: '💸' }
    ]
}]

This also works with 'simple' Emoji, consisting of only one Emoji:

var autocomplete = require('emoji-autocomplete');
 
var matchedEmoji = autocomplete.match('turtle');

The result will be:

[Emoji {
    name: 'turtle', 
    emoji: '🐢' 
}]

Find the Name for an Emoji

var autocomplete = require('emoji-autocomplete');
 
var matchedEmoji = autocomplete.name('🏠');

The result will be:

Emoji { 
    name: 'house',
    emoji: '🏠'
}

CLI Tools

This script comes with a few CLI tools for developers:

  • npm run search SEARCHTERM - Search for an Emoji
  • npm run add NAME EMOJI - Add a new Emoji Combination
  • npm run test - Run Unit Tests
  • npm run parse - Execute the Parser, turning source.js into the JSON-file used by this package

License

MIT. For details, please consult LICENSE.

Package Sidebar

Install

npm i emoji-autocomplete

Weekly Downloads

1

Version

0.1.2

License

MIT

Last publish

Collaborators

  • felixrieseberg