1.8.1 • Published 9 years ago
dem-feels v1.8.1
dem-feels
A meme based emoticon standard.
example
const demFeels = require('dem-feels');
demFeels('hello world! feelsgd');
// => hello world! <img src="https://cdn.rawgit.com/CreaturePhil/dem-feels/master/emotes/feelsgd.png" title="feelsgd" width="50" height="50" />'installation
$ npm install dem-feelsemotes
Visit http://creaturephil.github.io/dem-feels to see the list of emotes.
documentation
demFeels(message)
Parses the message with dem feels. Default maximum count of parsing amount of
emotes is 5.
demfeels.extendEmotes(newEmotes)
Add new emotes to the default list of emotes. newEmotes is an object.
Example:
demFeels.extendEmotes({
'feelsnew': 'feelsnew.png'
});demFeels.getEmotes()
Get an object of emotes. For example: {'feelsgd': 'https://cdn.rawgit.com/CreaturePhil/dem-feels/master/feelsgd.png'}
demFeels.setMaxCount(count)
Set the maximum number of emotes to parse. Defaults to 5. For example, limiting it to 1 will only parse one emote:
demFeels.setMaxCount(1);
demFeels('feelsgd feelsgd');
// => '<img src="https://cdn.rawgit.com/CreaturePhil/dem-feels/master/emotes/feelsgd.png" title="feelsgd" width="50" height="50" /> feelsgd'demFeels.setImageSize(size)
Set the size of the emotes' image. The default size is 50 pixels.
demFeels.setImageSize(40);
demFeels('hi feelsgd');
// => 'hi <img src="https://cdn.rawgit.com/CreaturePhil/dem-feels/master/emotes/feelsgd.png" title="feelsgd" width="40" height="40" />'But setting it to 2 will parse two emotes:
demFeels.setMaxCount(2);
demFeels('feelsgd feelsgd');
// => <img src="https://cdn.rawgit.com/CreaturePhil/dem-feels/master/emotes/feelsgd.png" title="feelsgd" width="50" height="50" /> <img src="https://cdn.rawgit.com/CreaturePhil/dem-feels/master/emotes/feelsgd.png" title="feelsgd" width="50" height="50" />'