Narcoleptic Programmers' Medicine

    generate-random-data

    0.0.3 • Public • Published

    generate-random-data

    Javascript utilities for generating random data.

    MIT License

    tag:? build:? coverage:?

    npm: downloads:? dependencies:?

    Install with npm:

    npm install generate-random-data

    Use with node.js:

    var random = require('generate-random-data');
    random.int(1, 99); // => 13

    Usage

    This module provides many util functions for generating random data:

    • int(min, max) or integer(min, max)
    • natural(min, max)
    • d?(max)
    • float(iMin, iMax, dMin, dMax, precision)
    • bool(min, max, seed) or boolean(min, max, seed)
    • char(pool) or character(pool)
    • str(pool, min, max) or string(pool, min, max)
    • range(start, stop, step)
    • pickOne(arr)
    • pickSome(arr, count, shuffle)
    • shuffle(arr)
    • datetime(date, format)
    • randomDate(min, max)
    • formatDate(data, format)
    • parseDate(...)
    • now(unit, format)
    • date(date, format)
    • time(date, format)
    • language() or lang()
    • zipcode(length) or zip(length)
    • mobile()
    • guid()
    • id()
    • maleFirstName()
    • femaleFirstName()
    • lastName()
    • name(middleName)
    • ip()
    • tld()
    • domain(tld)
    • email(domain)
    • url()
    • color()
    • capitalize(word)
    • upper(str)
    • lower(str)
    • word(min, max)
    • sentence(min, max)
    • title(min, max)
    • paragraph(min, max)
    • lorem()
    • lorems()

    Changelog

    Install

    npm i generate-random-data

    DownloadsWeekly Downloads

    234

    Version

    0.0.3

    License

    MIT

    Last publish

    Collaborators

    • bubkoo