Flavors of random emoji: fortunes, haikus, etc.
Branch: master
Clone or download
lukekarrys Merge pull request #18 from lukekarrys/greenkeeper/code-5.0.0
Update code to the latest version 🚀
Latest commit 6c2a460 Sep 29, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test deps Aug 8, 2016
.gitignore
.travis.yml add eslint because of weird npm ls errors with both standard and lab … Apr 7, 2017
README.md Update README.md May 1, 2017
index.js deps Aug 8, 2016
package.json

README.md

random-emoji

Get random emoji!

NPM Build Status Greenkeeper badge

Install

npm install random-emoji

Usage

Basic

var randomEmoji = require('random-emoji');

// Array of five random emoji
randomEmoji.random({count: 5});

// Array of lines for an emoji haiku
randomEmoji.haiku({
    host: '/images'
});

// Each array is made up of emoji objects
[{
    "character": "🐳",
    "name": "whale",
    "image": "<img class=\"emoji\" title=\"whale\" alt=\"whale\" src=\"/images/whale.png\" height=\"64\" />",
    "imageSrc": "/images/whale.png"
},
{
    "character": "🍮",
    "name": "custard",
    "image": "<img class=\"emoji\" title=\"custard\" alt=\"custard\" src=\"/images/custard.png\" height=\"64\" />",
    "imageSrc": "/images/custard.png"
}]

Options

{
    // The number of emojis to return (only for `random`)
    count: 3,
    // The height of each image in the returned image tag (defaults to '64')
    height: 64,
    // The host will be prepened to the src in the image tag (defaults to '/')
    host: '/'
}

Methods

  • random(): Random emojis!
  • haiku(): Returns a three item array made up enough emojis in each so the names contain 5, 7, 5 syllables

Credits

Credit to nlf for all the haiku code.

License

MIT