Skip to content

πŸ— random emoji function with zero dependencies

License

Notifications You must be signed in to change notification settings

0xadada/random-emoji

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

@0xadada/random-emoji

random emoji function with zero dependencies

Benefits

  • zero dependencies
  • doesn't define a range of emoji, just uses math

Usage

$ npm i @0xadada/random-emoji
$ npm run -s start
> πŸ™„
$ npm run -s start
> 😜
$ node
> const { random } = require('@0xadada/random-emoji');
> random()
'😁'
> let a = random();  // defaults to 'emoticons'
> let b = random('emoticons');
> let c = random('food');
> let d = random('animals');
> let e = random('expressions');
> console.log(a, b, c, d, e);
😍 πŸ™„ πŸ— πŸ₯ 🀒

Arguments

Invoked without arguments, the function will return an emoji character within the 'emoticons' range of unicode characters.

Range

random accepts an optional String argument. This string describes the characters within a subset of the unicode block that random will be limited to. Current options are: