unique-random
Generate random numbers that are consecutively unique
Last updated 5 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install unique-random 
SYNC missed versions from official npm registry.

unique-random

Generate random numbers that are consecutively unique

Useful for things like slideshows where you don't want to have the same slide twice in a row.

Install

$ npm install unique-random

Usage

import uniqueRandom from 'unique-random';

const random = uniqueRandom(1, 10);

console.log(random(), random(), random());
//=> 5 2 6

API

uniqueRandom(minimum, maximum)

Returns a function, that when called, will return a random number that is never the same as the previous.

Related

Current Tags

  • 3.0.0                                ...           latest (5 years ago)

6 Versions

  • 3.0.0                                ...           5 years ago
  • 2.1.0                                ...           7 years ago
  • 2.0.0                                ...           8 years ago
  • 1.0.0                                ...           12 years ago
  • 0.1.1                                ...           12 years ago
  • 0.1.0                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (3)
Dependents (2)

Copyright 2013 - present © cnpmjs.org | Home |