0.2.6 • Published 8 years ago

emoji-text v0.2.6

Weekly downloads
1,433
License
ISC
Repository
github
Last release
8 years ago

Emoji-Text

Converts emoji in a string into textual descriptions.

Examples

	var emojiText = require("emoji-text");

	emojiText.convert("🐱🐶"); // "[cat][dog]"

	emojiText.convert("🐔 🌵", {
  	delimiter: ':'
	}); // ":chicken: :cactus:"

	emojiText.convert("👻 🐴", {
		callback: function(emoji,data) {
			return "%" + data.description.toLowerCase() + "%";
		}
	}); // "%ghost% %horse face%"

Parameters

emojiText.convert(str, options);

str

The string to convert, expected to have emoji encoded as UTF-8.

options

{
	before: '[', // character to use before field
	after: ']', // character to use after field
	delimiter: ':', // shortcut to set before + after to same char
	field: 'name', // field to use name, description or emoji,
	callback: function(emoji, data) {} // custom conversion callback
}

data

The data object comes from wemoji and looks like this:

{ emoji: '🏩',
  platforms: [ 'tw', 'a', 'g' ],
  description: 'LOVE HOTEL',
  name: 'love_hotel',
  css: 'love_hotel',
  category: 'travel' }

Install

Install with npm:

npm install emoji-text

License

ISC

Built with Wedgies

0.2.6

8 years ago

0.2.5

9 years ago

0.2.4

9 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.0

9 years ago