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

@jasgues/randomtools

v1.0.2

Published

Simple JavaScript utilities for random colors, numbers, strings, IDs, emails, names, passwords, and dates.

Readme

@jasgues/randomtools

A lightweight utility library for generating random colors, numbers, strings, IDs, emails, names, passwords, and dates.

Features

  • 🎨 Generate random HEX color codes
  • 🔢 Generate random integers within a specified range
  • 🔤 Generate random strings for tokens and test data
  • 🆔 Generate UUIDs
  • 📧 Generate random emails
  • 👤 Generate random names
  • 🔐 Generate random passwords
  • 📅 Generate random dates
  • ⚡ Zero dependencies
  • 📦 Lightweight and easy to use

Installation

npm install @jasgues/randomtools

Usage

const {
  randomColor,
  randomNumber,
  randomString,
  randomUUID,
  randomEmail,
  randomName,
  randomPassword,
  randomDate
} = require("@jasgues/randomtools");

// Generate a random HEX color
console.log(randomColor());
// Example: "#4FA2D8"

// Generate a random integer between 1 and 100
console.log(randomNumber(1, 100));
// Example: 42

// Generate a random string
console.log(randomString(16));
// Example: "aZ7kP1xQ9mL2tR4b"

// Generate a UUID
console.log(randomUUID());
// Example: "550e8400-e29b-41d4-a716-446655440000"

// Generate a random email
console.log(randomEmail());
// Example: "[email protected]"

// Generate a random name
console.log(randomName());
// Example: "Alex Demir"

// Generate a random password
console.log(randomPassword(16));
// Example: "Q7!m2p#kL9s@v4Xz"

// Generate a random date
console.log(randomDate(new Date(2020, 0, 1), new Date(2025, 11, 31)));
// Example: 2023-08-14T10:22:31.000Z

API

randomColor()

Generates a random HEX color string.

Returns

  • string — A color in the format #RRGGBB.

Example

const color = randomColor();

console.log(color);
// "#A13EF7"

randomNumber(min, max)

Generates a random integer between min and max (inclusive).

Parameters

| Parameter | Type | Description | | --------- | -------- | ------------- | | min | number | Minimum value | | max | number | Maximum value |

Returns

  • number — A random integer between min and max.

Example

const number = randomNumber(10, 20);

console.log(number);
// 17

randomString(length = 12)

Generates a random alphanumeric string.

Parameters

| Parameter | Type | Description | | --------- | -------- | ----------- | | length | number | String length |

Returns

  • string - A random alphanumeric string.

randomUUID()

Generates a random UUID.

Returns

  • string - A UUID string.

randomEmail()

Generates a random email address.

Returns

  • string - A random email address.

randomName()

Generates a random full name.

Returns

  • string - A random first and last name.

randomPassword(length = 16)

Generates a random password with upper-case letters, lower-case letters, numbers, and symbols.

Parameters

| Parameter | Type | Description | | --------- | -------- | ----------- | | length | number | Password length |

Returns

  • string - A random password.

randomDate(start = new Date(2000, 0, 1), end = new Date())

Generates a random Date between start and end.

Parameters

| Parameter | Type | Description | | --------- | -------- | ----------- | | start | Date | Minimum date | | end | Date | Maximum date |

Returns

  • Date - A random date object.

License

ISC

Author

Jasgues