1.2.0 • Published 4 years ago

unique-values-generator v1.2.0

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

unique-values-generator is a node package for generating unique numbers which still persists even if the server has lost connection or the server is off.

It truly generates unique numbers with an option to prefix the generated numbers with your own text

Guide to using the package in your project

In your project directory, run npm install unique-values-generator OR yarn add unique-values-generator

You can then require it in your file and use it const uniquevalues   =   require('unique-values-generator'); const value  =  uniquevalues.generate(1000,{increment:1,prefix:'Patient'});

console.log(value);  # Patient1000, Patient1001, Patient1002, ...

Three way usage. You can choose any which suits your needs.

Usage 1 const uniquevalues   =   require('unique-values-generator'); #Example;   let num   =   uniquevalues.generate(100)   //   returns series of unique number on every call

uniquevalues.generate(startValue); //startValue can be any number

Clear data from storage

const uniquevalues   =   require('unique-values-generator'); uniquevalues.clear();

Usage 2 const uniquevalues   =   require('unique-values-generator'); #Example;   let num   =   uniquevalues.generate(100, 1)   //   returns series of unique number on every call.. 100, 101, 102...

uniquevalues.generate(startValue, increment);

Usage 3 (with optional parameters) const uniquevalues   =   require('unique-values-generator'); #Example   let num  =  uniquevalues.generate(1000,{increment:1,prefix:'Patient'});  //   Patient1000, Patient1001, Patient1002, ...

uniquevalues.generate(startValue, {increment, prefix});

1.2.0

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.4

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago