Skip to Content
๐ŸŽฒ Welcome to RandBox - Powerful JavaScript Random Data Generation Library! Learn More

๐ŸŽฒ RandBox Full Feature Overview

RandBox is a powerful JavaScript random data generation library, offering over 100 data types across 10+ major categories to meet your diverse needs in development, testing, and data simulation!

Powerful Features

RandBox provides a rich API and flexible configuration options, supporting comprehensive random data generation from basic data types to complex business scenarios. Whether for unit testing, data population, or rapid prototyping, RandBox offers a reliable solution.

๐ŸŽฏ Usage Methods Module

RandBox supports multiple environments and usage methods, making integration into various projects easy:

  • ๐ŸŒ Browser Environment: Supports simple, intermediate, and advanced usage to meet different complexity needs.
  • ๐Ÿ“ฆ Package Managers: Supports installation via mainstream package managers like Bower, npm, and yarn.
  • ๐Ÿ”ง Module Loading: Compatible with various loading methods, including RequireJS and ES6 modules.
  • ๐Ÿ–ฅ๏ธ Node.js Environment: Perfect support for server-side JavaScript development.
  • โš™๏ธ Custom Functionality: Supports custom random functions and a CLI command-line tool.
  • ๐ŸŒฑ Seed System: Supports number, string, and multi-parameter seeds to ensure reproducible randomness.

๐ŸŽจ Basic Data Types

Core random data generation features, covering all basic data types:

  • ๐Ÿ”ข Numeric Types: Boolean, Integer, Floating-point, Natural Number, Prime Number
  • ๐Ÿ”ค Character Types: Random Character, Letter, String, Template String
  • ๐Ÿ“ Special Types: JavaScript Falsy values, Hexadecimal, Buffer

๐Ÿ’ฐ Financial Data Module

Professional financial data generation, compliant with real-world standards:

  • ๐Ÿ’ณ Credit Card System: Luhn-compliant credit card numbers, CVV, expiration dates
  • ๐Ÿฆ Currency System: Random currency codes, currency pairs, USD/Euro amounts
  • ๐ŸŒ International Standards: Supports IBAN and various credit card type identification

๐Ÿ› ๏ธ Helper Tools Module

Practical data manipulation and processing tools:

  • ๐ŸŽฒ Array Operations: Random selection, shuffling, unique value generation
  • ๐Ÿ”ง String Utilities: Capitalization, number padding, weighted selection
  • โšก Performance Optimization: Mixin functionality, dataset overriding, batch generation

๐ŸŒ Geographical Location Module

Global geographical data generation, supporting multiple countries and regions:

  • ๐Ÿ  Address System: Street address, City, Country, Coordinates
  • ๐Ÿ“ž Communication Info: Phone numbers, Area codes (supports USA, UK, France)
  • ๐Ÿ—บ๏ธ Geographical Data: Latitude, Longitude, Altitude, Depth, Geohash, Timezone

๐ŸŽฎ Miscellaneous Tools Module

A wealth of practical utilities and gamified features:

  • ๐ŸŽฏ Random Selection: Coin toss, Dice system (d4 to d100)
  • ๐Ÿ†” Identifier Generation: GUID, Hash value, Timestamp
  • ๐Ÿ“Š Statistical Features: Normal distribution, RPG dice system, Radio call signs

๐Ÿ“ฑ Mobile Device Module

Dedicated identifier generation for mobile platforms:

  • ๐Ÿค– Android Platform: GCM Registration ID, Device Identifier
  • ๐ŸŽ iOS Platform: Apple Push Token, Device Identification
  • ๐Ÿ“ฑ Other Platforms: BlackBerry PIN, Windows Phone ANID

๐ŸŽต Music Data Module

Professional music-related data generation:

  • ๐ŸŽผ Note System: Random musical notes, flats, sharps, natural notes
  • ๐ŸŽธ Music Genres: 22 main genres, over 600 subgenres
  • โฑ๏ธ Tempo System: Random tempo (40-320 BPM range)

๐Ÿ‘ค Personal Information Module

Comprehensive personal identity data generation, supporting multi-national standards:

  • ๐Ÿ“ Basic Information: Name, Age, Birthday, Gender, Zodiac Sign
  • ๐Ÿ†” Identity Documents: US SSN, Indian Aadhar, Italian CF, Brazilian CPF
  • ๐Ÿท๏ธ Title System: Name prefixes, suffixes, supporting multiple nationalities

๐Ÿ“ Text Generation Module

Intelligent text content generation:

  • ๐Ÿ“– Document Structure: Paragraphs, Sentences, Words, Syllables
  • ๐Ÿ˜Š Emojis: Supports categorization and length control
  • ๐Ÿ—ฃ๏ธ Phonetic Features: Generation of semi-pronounceable nonsense words

๐Ÿพ Entities Module

Random generation of various entities:

  • ๐Ÿฆ Animal System: Supports categories like marine, desert, grassland, forest, farm, pet, zoo

โฐ Date and Time Module

A complete time data generation system:

  • ๐Ÿ“… Date & Time: Random Date, Time, Timestamp, Timezone
  • ๐Ÿ• Time Components: Hour, Minute, Second, Millisecond, AM/PM indicator
  • ๐Ÿ“† Date Components: Year, Month, Weekday, Weekday restriction

๐ŸŒ Web Data Module

Comprehensive support for internet and network-related data:

  • ๐ŸŒ Network Identifiers: IP Address, IPv6, MAC Address, Domain Name
  • ๐Ÿ“ง Communication Tools: Email, URL, Social Media Username
  • ๐ŸŽจ Visual Elements: Color generation (6 formats like hex, rgb, rgba)
  • ๐Ÿข Business Data: Company Name, Profession, Google Analytics Code

Quick Start

Install RandBox

# Using npm npm install randbox # Using yarn yarn add randbox # Using bower bower install randbox

Basic Usage Example

import RandBox from 'randbox'; const randBox = new RandBox(); // Basic Data Types console.log(randBox.bool()); // true/false console.log(randBox.integer(1, 100)); // 42 console.log(randBox.string(10)); // "aBcD1234eF" // Personal Information console.log(randBox.name()); // "Sarah Johnson" console.log(randBox.email()); // "john.doe@example.com" console.log(randBox.age()); // 25 // Geographical Location console.log(randBox.city()); // "New York" console.log(randBox.country()); // "United States" console.log(randBox.coordinates()); // "40.7128, -74.0060" // Financial Data console.log(randBox.cc()); // "4111111111111111" console.log(randBox.currency()); // "USD"

Using a Seed for Reproducibility

import RandBox from 'randbox'; // Use the same seed to generate the same result const randBox1 = new RandBox(12345); const randBox2 = new RandBox(12345); console.log(randBox1.name()); // "Alice Smith" console.log(randBox2.name()); // "Alice Smith" (Same result)

Documentation and Support

Development Roadmap

RandBox will continue to be updated and optimized, with plans to add more practical features:

  • ๐ŸŒ More Regional Support: Expand data formats for more countries and regions
  • ๐Ÿš€ Performance Optimization: Continuously improve the efficiency of generation algorithms
  • ๐Ÿ“ฆ Modular Enhancements: Provide finer-grained module separation
  • ๐Ÿ”ง Custom Extensions: Support more flexible custom data types

If you find RandBox helpful, we welcome your support by clicking the โญ๏ธ Starย  button on the top right of the project! Every star is the greatest encouragement for us, helping the project to continuously improve and move forward. Thank you very much for your support! ๐ŸŽฒ

Last updated on: