1.0.3 • Published 8 years ago

random-unicodes v1.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

random-unicodes

Return a random unicode.

MIT License

build:? coverage:?

Install

$ npm install --save random-unicodes

Usage

For more use-cases see the tests

var randomUnicode = require('random-unicodes');

// API
// - randomUnicode([options]);

// options
// - min
// - max

By default it will return an unicode between 0 and 1114109, unicode ranges:

randomUnicode();
// => '\uaf91'

Can optionally provide min and max:

randomUnicode({ max: '\\uFFFF' });
// => '\u00F4'

randomUnicode({ min: 0, max: 1114109 });
// => '\u2F7FF'

Note: these min and max are inclusive, so they are included in the range.

Related

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.