Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jamesfrost/twitch-emoji
Parse Twitch emotes
https://github.com/jamesfrost/twitch-emoji
channel-emojis emoji emotes kappa twitch twitch-tv
Last synced: about 4 hours ago
JSON representation
Parse Twitch emotes
- Host: GitHub
- URL: https://github.com/jamesfrost/twitch-emoji
- Owner: JamesFrost
- License: mit
- Created: 2016-09-12T16:31:00.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-11T20:23:00.000Z (almost 7 years ago)
- Last Synced: 2024-11-16T15:37:40.087Z (1 day ago)
- Topics: channel-emojis, emoji, emotes, kappa, twitch, twitch-tv
- Language: JavaScript
- Homepage: http://jamesfrost.me/twitch-emoji/
- Size: 50.6 MB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# twitch-emoji :zap:
Parse Twitch emojis.Powered by twitchemotes.com.
```bash
npm install --save twitch-emoji
``````html
```
## Usage
### Browser
For use client side, I recommend using the above CDN. 'Requiring' the module and then using a build task like browserify will add ~4mb to your final file size. This is because the node module has all channel specific emojis preloaded.
Using the cdn will allow you to dynamically load channel specific emojis, meaining you won't add 4mb of (mostly) redundant JSON to your Javascript.
The browser module has global emojis preloaded.
#### API
##### ``` .parse( text [, options ]) ```###### options.emojiSize
Small, medium or large. Default is medium.###### options.channel
Used to parse channel specific emojis. Note that the channel emojis must be added first.```js
console.log( twitchEmoji.parse( 'spicey memes Kappa' ), { emojiSize : 'medium' } );// Will produce:
/*
spicey memes
*/
```
##### ``` .add( channelName [, callback] ) ```Load a channel specific emoji set.
###### channelName
The name of the channel to load the emoji set for.###### callback
Optional. Has a single error argument.Returns a promise.
An error will be passed to the callback, and the promise rejected if the channel doesn't have specific emoji sets.
```js
// Using the callback
twitchEmoji.add('twoeasy', function( err )
{
if( !err )
// Emoji Set Usable
});
// Using a promise
twitchEmoji.add('twoeasy').then(
function( response )
{
// Emoji Set Usable
},
function( response )
{
// Emoji set not accessable/doesn't exist
}
);
```### Node
#### API
##### ``` .parse( text [, options ]) ```
###### options.emojiSize
Small, medium or large. Default is medium.###### options.channel
Used to parse channel specific emojis.```js
console.log( twitchEmoji.parse( 'spicey memes Kappa' , { emojiSize : 'medium' } ) );// Will produce:
/*
spicey memes
*/
```## License
MIT