GitHunt
0X

0xadada/random-emoji

๐Ÿ— random emoji function with zero dependencies

@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:

Languages

JavaScript80.3%TypeScript19.7%

Contributors

MIT License
Created October 5, 2019
Updated March 1, 2025
0xadada/random-emoji | GitHunt