/unique_id

Generate random numbers

Primary LanguageJavaScript

Contributors Forks Stargazers Issues


unique_id

Generate random numbers and strings!
Docs »

Report Bug · Request Feature

Installation

With npm

npm install --save @naseelniyas/unique_id

With yarn

yarn add @naseelniyas/unique_id

Usage & Examples

Generating a random integer between below 500(cann be any number of course):

const unique = require('@naseelniyas/unique_id');

//Change the number for a different max value
const num = unique.uniqueInt(500);

console.log(num)

Generate a random string (useful for uuids)

const unique = require('@naseelniyas/unique_id');

const str = unique.uniqueString()

console.log(str)

Random from an array

const unique = require('@naseelniyas/unique_id');
//Sample array with sample data
const arr = ['unique', 'string', 'array', 'javascript is awesome'];

const uniqueValue = unique.uniqueFromArray(arr);

console.log(uniqueValue);

Decimal between 0 and one

const unique = require('@naseelniyas/unique_id');

const num = unique.zeroToOne();

console.log(num);

Contribution:

If you wanted to contribute to this project you can do so! Just create an issue on GitHub!

Repository Url: https://github.com/NaseelNiyas/unique_id

If you found this package helpful, then why not star ⭐🌟 the project, It would be helpful

Naseel Niyas from techharvesting