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 🙏

© 2024 – Pkg Stats / Ryan Hefner

random-ease

v1.0.8

Published

A powerful and versatile library for generating random data and values. It provides a wide range of functions to generate random numbers, strings, arrays, booleans, dates, colors, names, addresses, and more. The package is designed to simplify the generat

Downloads

205

Readme

random-ease

npm License Known Vulnerabilities

A powerful and versatile library for generating random data and values. It provides a wide range of functions to generate random numbers, strings, arrays, booleans, dates, colors, names, addresses, and more. The package is designed to simplify the generation of random data for testing, prototyping, and data simulation purposes.

Installation

Install the package using npm:

npm install random-ease

Usage

Import the package and start generating random data with ease:

const randomEase = require('random-ease');

// Generates a random number within a specified range
console.log(randomEase.generateNumber(10, 10000));

// Generates a random string of a specified length using alphanumeric characters
console.log(randomEase.generateString(25));

// Generates an array of random numbers within a given range
console.log(randomEase.generateArray(5, 10, 15));

or in typescript

import randomEase from 'random-ease';
// or
// import { generateNumber } from 'random-ease';

// Generates a random boolean value
console.log(randomEase.generateBoolean());

Available Helper Functions

| Definition | Purpose | | --------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | | generateNumber(min: number, max: number): number | Generates a random number within a specified range | | generateString(length: number): string | Generates a random string of a specified length using alphanumeric characters | | generateArray(length: number, min: number, max: number): number[] | Generates an array of random numbers within a given range | | generateBoolean(): boolean | Generates a random boolean value | | generateFloat(min: number, max: number): number | Generates a random floating-point number within a given range | | generateRandomElement<T>(array: T[]): T | Generates a random element from an array | | generateRandomDate(start: Date, end: Date): Date | Generates a random date within a given range | | generateRandomColor(): string | Generates a random RGB color value | | generateRandomHexColor(): string | Generates a random hexadecimal color value | | shuffleArray<T>(array: T[]): T[] | To shuffle an array randomly | | generateEmailAddress(): string | Generates a random email address | | generateGUID(): string | Generates a random GUID (Globally Unique Identifier) | | generateIPv4Address(): string | Generates a random IPv4 address | | generateMACAddress(): string | Generates a random MAC address | | generateUUID(): string | Generates a random UUID (Universally Unique Identifier) | | generateRandomTime(): string | Generates a random time in 24-hour format | | generatePhoneNumber(): string | Generates a random phone number | | generateFileName(extension: string): string | Generates a random file name with extension | | generateURL(): string | Generates a random URL | | generateCurrencyCode(): string | Generates a random currency code | | generateJobTitle(): string | Generate a random job title | | generateCreditCardNumber(): string | Generates a random credit card number (dummy) | | generateCountry(): string | Generates a random country | | generateBooleanWithProbability(probability: number): boolean | Generates a random boolean value with a given probability | | generatePassword(length: number, includeUppercase: boolean, includeNumbers: boolean, includeSymbols: boolean): string | Generates a random password with a given length and complexity | | generateUsername(): string | Generates a random username | | generateAddress(): string | Generates a random address | | generateSentence(wordCount: number): string | Generates a random sentence | | generateParagraph(sentenceCount: number, wordsPerSentence: number): string | Generates a random paragraph | | generateSlug(title: string): string | Generates a random URL slug | | generateAvatar(avatarSize = 200): string | Generates a random avatar URL | | generateSocialMediaHandle(): string | Generates a random social media handle | | generateISBN(): string | Generates a random ISBN (International Standard Book Number) | | generateMovieTitle(): string | Generates a random movie title | | generateBookTitle(): string | Generates a random book title | | generateQuote(): string | Generates a random quote | | generateLicensePlate(): string | Generates a random license plate number | | generateCompanyName(): string | Generates a random company name | | generateTwitterHandle(): string | Generates a random Twitter handle | | generateSSN(): string | Generates a random social security number | | generateRegistrationNumber(): string | Generates a random vehicle registration number | | generateDomainName(): string | Generates a random domain name | | generateFruit(): string | Generates a random fruit | | generateProgrammingLanguage(): string | Generates a random programming language | | generateUniversityName(): string | Generates a random university name | | generateSportsTeamName(): string | Generates a random sports team name | | generateProgrammingFramework(): string | Generates a random programming framework | | generateZodiacSign(): string | Generates a random Zodiac sign | | generateJobIndustry(): string | Generates a random job industry | | generateCurrencySymbol(): string | Generates a random currency symbol | | generateJobLevel(): string | Generates a random job level | | generateVehicleMake(): string | Generates a random vehicle make | | generateTimeZone(): string | Generates a random time zone |

License

This package is open-source and released under the MIT License.