npm.io
1.0.3 • Published 10 years ago

random-unicodes

Licence
MIT
Version
1.0.3
Deps
6
Vulns
0
Weekly
0
Stars
1

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.

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

Keywords