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

rnget

v1.0.1

Published

Random data generator

Readme

🔮 rnget

Useful JavaScript library for generating random data.

Installation

npm install rnget

Examples

const Random = require("rnget");

Random.characterSequence({
    length: 30,
    uCharacters: false,
    lCharacters: true,
    specialSymbols: true,
    numbers: true
});
// k)$1[icoee00:c=z\e6olmznr@0g3o

Random.characterSequence({
    length: 30,
    uCharacters: false,
    lCharacters: false,
    specialSymbols: true,
    numbers: true
});
// .45.23@05@04320>0;363:25-4+063

Random.color.HEX(); // #e38651
Random.color.CMYK(); // cmyk(71%, 43%, 26%, 70%)
Random.color.name(); // darkblue

Random.elementFromObject.objProp({
    name: "John",
    age: 22,
    nationality: "French"
});
// { nationality: 'French' }

Random.elementFromObject.objKeyVal({
    name: "Alex",
    age: 37,
    nationality: "Italian"
});
// Alex

Random.elementFromArray({
    array: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
    startingFromIndex: 4,
    endingWithIndex: 7
})
// 7

Documentation

.number([options])

Generates a random number in a specific range. Parameter | Type | Required | Description :----: | :----: | :----: | :----: range | Array | yes | The range of numbers in which the number will be generated.

Example:

Random.number({ range: [1, 100] });

.numbers([options])

Generates an array of random numbers in a specific range.

Parameter | Type | Required | Description :----: | :----: | :----: | :----: range | Array | yes | The range in which the numbers will be generated. quantity | Number | yes | The number of random numbers to be generated.

Example:

Random.numbers({ range: [1, 100], quantity: 10 })

.elementFromArray([options])

Returns a random element from an array.

Parameter | Type | Required | Description :----: | :----: | :----: | :----: array | Array | yes | Array of elements. startingFromIndex | Number | no | - endingWithIndex | Number | no | -

Example:

Random.elementFromArray({ array: [0, true, 2, false, 4, "str"], startingFromIndex: 2 })

.elementsFromArray([options])

Returns an array of random elements from an array.

Parameter | Type | Required | Description :----: | :----: | :----: | :----: array | Array | yes | Array of elements. quantity | Number | yes | The number of random elements from the array. startingFromIndex | Number | no | - endingWithIndex | Number | no | -

Example:

Random.elementsFromArray({ array: [false, false, "str", 3, 4, 5], quantity: 3, endingWithIndex: 4 })

.elementFromObject.objKey(object)

Returns a random key from an object.

Example:

Random.elementFromObject.objKey({ one: 1, two: 2, three: 3 })

.elementFromObject.objKeyVal(object)

Returns the value of a random key from an object.

Example:

Random.elementFromObject.objKeyVal({ name: "John", age: 22, nationality: "Italian" })

.elementFromObject.objProp(object)

Returns a random property from an object.

Example:

Random.elementFromObject.objProp({ name: "Alex", age: "37", "favorite color": "yellow" })

.color.HEX()

Generates a random HEX color.

.color.RGB()

Generates a random RGB color.

.color.HSL()

Generates a random HSL color.

.color.HWB()

Generates a random HWB color.

.color.CMYK()

Generates a random CMYK color.

.color.name()

Generates a random color name.

.characterSequence([options])

Generates a random sequence of characters.

Parameter | Type | Required | Default | Description :----: | :----: | :----: | :----: | :----: length | Number | yes | - | Length of character sequence. lCharacters | Boolean | no | true | Can a character sequence contain lowercase letters? uCharacters | Boolean | no | true | Can a character sequence contain uppercase letters? numbers | Boolean | no | false | Can a character sequence contain numbers? specialSymbols | Boolean | no | false | Can a character sequence contain special symbols?

Example:

Random.characterSequence({
    length: 100,
    lCharacters: false,
    uCharacters: false,
    numbers: true,
    specialSymbols: true
})

Found a bug?

Contact me by email: [email protected].