npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

random-in

v1.0.117

Published

A package to get random values

Readme

random-in

npm version MIT License PR's Welcome

Get Random Numbers, Names, Dates and much more.

Table of Contents

Installation

npm install random-in

Numbers

Get Random Integer of n Digit

getNDigit(n) --> n is number of digits

const { getNDigit } = require('random-in');
console.log(getNDigit(5)); // 24646

Get Random Integer in a given range

getRandomBetween(min, max) ---> to get a random number between min and max

Note: min and max are inclusive i.e. getRandomBetween(1,100) may return 1 or 100

const { getRandomBetween } = require('random-in');
console.log(getRandomBetween(5, 50)); // 26

Get Random Floating number in a given range

getRandomFloatBetween(min, max) --> to get a random floating number between min and max

const { getRandomFloatBetween } = require('random-in');
console.log(getRandomFloatBetween(5, 50)); // 19.69726289036264

Get N Random Number in a given range

getNRandomBetween(n, min, max) --> to get n random numbers between min and max

const { getNRandomBetween } = require('random-in');
console.log(getNRandomBetween(5, 1, 50)); // [34, 23, 28, 6, 14]

Names

Get random users name

Get Random Name

Get a random full name of any gender

const { getName } = require('random-in');
console.log(getName()); // "Winnifred Struble"

Get Random Male Name

Get a random full name (Male)

const { getMaleName } = require('random-in');
console.log(getMaleName()); // "Derek Gilstrap"

Get Random Female Name

Get a random full name (Female)

const { getFemaleName } = require('random-in');
console.log(getFemaleName()); // "Gerri Bavaro"

Get Random Male First Name

Get a random first name (Male)

const { getMaleFirstName } = require('random-in');
console.log(getMaleFirstName()); // Jamey

Get Random Female First Name

Get a random first name (Female)

const { getFemaleFirstName } = require('random-in');
console.log(getFemaleFirstName()); // "Beckie"

Get Random Last Name

Get a random last name

const { getLastName } = require('random-in');
console.log(getLastName()); // "Reinbold"

Get Random Indian Name

Get a random Indian full name of any gender

const { getIndianName } = require('random-in');
console.log(getIndianName()); // "Nagendra Shankar"

Get Random Indian Male Name

Get a random Indian full name (Male)

const { getIndianMaleName } = require('random-in');
console.log(getIndianMaleName()); // "Ashok Dalal"

Get Random Indian Female Name

Get a random Indian full name (Female)

const { getIndianFemaleName } = require('random-in');
console.log(getIndianFemaleName()); // "Deepali Bose"

Get Random Indian Male First Name

Get a random Indian first name (Male)

const { getIndianMaleFirstName } = require('random-in');
console.log(getIndianMaleFirstName()); // "Mukul"

Get Random Indian Female First Name

Get a Random Indian first name (Female)

const { getIndianFemaleFirstName } = require('random-in');
console.log(getIndianFemaleFirstName()); // "Anandi"

Get Random Indian Last Name

Get a random Indian last name

const { getIndianLastName } = require('random-in');
console.log(getIndianLastName()); // "Pant"

Dates

Get Random Dates

Get Random Date in between two Dates

Get a random date between two dates

Note: new Date(YYYY, MM, DD) If month is less than 10, let's say 4, use 4 instead of 04 If date is less than 10, let's say 6, use 6 instead of 06

const { getDateBetween } = require('random-in');
console.log(getDateBetween(new Date(1947, 8, 15), new Date()));
// Tue Aug 07 1956 10:42:05 GMT+0530 (India Standard Time)

Get Random Date (Future)

Get a random date from future

Note: Default future date limit is 50 years from current date. getRandomDateFuture(futureYear). futureYear is of type "number".

const { getRandomDateFuture } = require('random-in');
console.log(getRandomDateFuture(2021));
// 2021-07-22T00:50:23.025Z

Emails

Get Random Email Address

Get Random Email Id

Get a random email id

const { getRandomEmail } = require('random-in');
console.log(getRandomEmail()); // "[email protected]"

Passwords

Get Random Passwords

Get Alphanumeric Password

Get a random alphanumeric password of n length

const { getAlphanumericPassword } = require('random-in');
console.log(getAlphanumericPassword(8)); // "IVYs4uI9"

Get Lowercase Password

Get a random lowercase alphanumeric password of n length

const { getLowercasePassword } = require('random-in');
console.log(getLowercasePassword(8)); // "ffm690dx"

Get Uppercase Password

Get a random uppercase alphanumeric password of n length

const { getUppercasePassword } = require('random-in');
console.log(getUppercasePassword(8)); // "S7PM8AOO"

Get Alpha Password

Get a random only alphabet password of n length

const { getAlphaPassword } = require('random-in');
console.log(getAlphaPassword(8)); // "juYyjMJs"

Get Alpha Lowercase Password

Get a random only lowercase alphabets password of n length

const { getAlphaLowercasePassword } = require('random-in');
console.log(getAlphaLowercasePassword(8)); // "stysfpbs"

Get Alpha Uppercase Password

Get a random only uppercase alphabets password of n length

const { getAlphaUppercasePassword } = require('random-in');
console.log(getAlphaUppercasePassword(8)); // "ZHKNQYTY"

Get Numeric Password

Get a random numeric password of n length

const { getNumericPassword } = require('random-in');
console.log(getNumericPassword(8)); // "94970880"

Country

Get Random Country

Get Random Country

Get a random country name

const { getCountry } = require('random-in');
console.log(getCountry()); // "United Kingdom"

Color

Get Random Color

Get Random Color

Get a random hex color

const { getRandomColorHex } = require('random-in');
console.log(getRandomColorHex()); // "#94FA02"

Programming

Get random programming stuff

Get random programming language

Get a random programming language

const { getRandomProgrammingLanguage } = require('random-in');
console.log(getRandomProgrammingLanguage()); // "Julia"