Return a random version.
$ npm install --save random-semver
var randomVersion = require('random-semver');
// API
// - randomVersion([options]);
// options
// - range
// - preRelease
By default, returns a version like this:
randomVersion();
// => '1.0.1'
Optionally specify range:
randomVersion({ range: '>' });
// => '>3.8.6'
randomVersion({ range: true });
// => '~2.5.1'
Optionally specify preRelease:
randomVersion({ preRelease: '-dev' });
// => '4.8.6-dev'
randomVersion({ preRelease: true });
// => '2.5.1-beta'
- random-uuid - Return a random uuid.
- random-identity - Return a random ID.
- random-dx - Return a value equal to the roll of a die.
- random-hexhash - Return a random hex hash.
- random-normal - Return a normally-distributed random variate.
- random-rpg - Return an array of dice values.
- random-file - Return a random file name with random extension.
Pull requests and stars are highly welcome.
For bugs and feature requests, please create an issue.