generate-random-data

Javascript utilities for generating random data.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
generate-random-data
410.0.38 years ago9 years agoMinified + gzip package size for generate-random-data in KB

Readme

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