Namespace: random

faker. random

Methods


<static> alpha(options)

alpha. returns lower/upper alpha characters based count and upcase options

Parameters:
Name Type Description
options mixed

// defaults to { count: 1, upcase: false }


<static> alpha(options)

alpha. returns lower/upper alpha characters based count and upcase options

Parameters:
Name Type Description
options mixed

// defaults to { count: 1, upcase: false }


<static> alphaNumeric(count)

alphaNumeric

Parameters:
Name Type Description
count number

defaults to 1


<static> alphaNumeric(count)

alphaNumeric

Parameters:
Name Type Description
count number

defaults to 1


<static> arrayElement(array)

takes an array and returns a random element of the array

Parameters:
Name Type Description
array array

<static> arrayElement(array)

takes an array and returns a random element of the array

Parameters:
Name Type Description
array array

<static> arrayElements(array, count)

takes an array and returns a subset with random elements of the array

Parameters:
Name Type Description
array array
count number

number of elements to pick


<static> arrayElements(array, count)

takes an array and returns a subset with random elements of the array

Parameters:
Name Type Description
array array
count number

number of elements to pick


<static> boolean()

boolean


<static> boolean()

boolean


<static> float(options)

returns a single random floating-point number based on a max number or range

Parameters:
Name Type Description
options mixed

<static> float(options)

returns a single random floating-point number based on a max number or range

Parameters:
Name Type Description
options mixed

<static> hexaDecimal(count)

hexaDecimal

Parameters:
Name Type Description
count number

defaults to 1


<static> hexaDecimal(count)

hexaDecimal

Parameters:
Name Type Description
count number

defaults to 1


<static> image()

locale


<static> image()

locale


<static> locale()

locale


<static> locale()

locale


<static> number(options)

returns a single random number based on a max number or range

Parameters:
Name Type Description
options mixed

{min, max, precision}


<static> number(options)

returns a single random number based on a max number or range

Parameters:
Name Type Description
options mixed

{min, max, precision}


<static> objectElement(object, field)

takes an object and returns the randomly key or value

Parameters:
Name Type Description
object object
field mixed

<static> objectElement(object, field)

takes an object and returns the randomly key or value

Parameters:
Name Type Description
object object
field mixed

<static> uuid()

uuid


<static> uuid()

uuid


<static> word(type)

word

Parameters:
Name Type Description
type string

<static> word(type)

word

Parameters:
Name Type Description
type string

<static> words(count)

randomWords

Parameters:
Name Type Description
count number

defaults to a random value between 1 and 3


<static> words(count)

randomWords

Parameters:
Name Type Description
count number

defaults to a random value between 1 and 3

Namespace: random

faker. random

Methods


<static> alpha(options)

alpha. returns lower/upper alpha characters based count and upcase options

Parameters:
Name Type Description
options mixed

// defaults to { count: 1, upcase: false }


<static> alpha(options)

alpha. returns lower/upper alpha characters based count and upcase options

Parameters:
Name Type Description
options mixed

// defaults to { count: 1, upcase: false }


<static> alphaNumeric(count)

alphaNumeric

Parameters:
Name Type Description
count number

defaults to 1


<static> alphaNumeric(count)

alphaNumeric

Parameters:
Name Type Description
count number

defaults to 1


<static> arrayElement(array)

takes an array and returns a random element of the array

Parameters:
Name Type Description
array array

<static> arrayElement(array)

takes an array and returns a random element of the array

Parameters:
Name Type Description
array array

<static> arrayElements(array, count)

takes an array and returns a subset with random elements of the array

Parameters:
Name Type Description
array array
count number

number of elements to pick


<static> arrayElements(array, count)

takes an array and returns a subset with random elements of the array

Parameters:
Name Type Description
array array
count number

number of elements to pick


<static> boolean()

boolean


<static> boolean()

boolean


<static> float(options)

returns a single random floating-point number based on a max number or range

Parameters:
Name Type Description
options mixed

<static> float(options)

returns a single random floating-point number based on a max number or range

Parameters:
Name Type Description
options mixed

<static> hexaDecimal(count)

hexaDecimal

Parameters:
Name Type Description
count number

defaults to 1


<static> hexaDecimal(count)

hexaDecimal

Parameters:
Name Type Description
count number

defaults to 1


<static> image()

locale


<static> image()

locale


<static> locale()

locale


<static> locale()

locale


<static> number(options)

returns a single random number based on a max number or range

Parameters:
Name Type Description
options mixed

{min, max, precision}


<static> number(options)

returns a single random number based on a max number or range

Parameters:
Name Type Description
options mixed

{min, max, precision}


<static> objectElement(object, field)

takes an object and returns the randomly key or value

Parameters:
Name Type Description
object object
field mixed

<static> objectElement(object, field)

takes an object and returns the randomly key or value

Parameters:
Name Type Description
object object
field mixed

<static> uuid()

uuid


<static> uuid()

uuid


<static> word(type)

word

Parameters:
Name Type Description
type string

<static> word(type)

word

Parameters:
Name Type Description
type string

<static> words(count)

randomWords

Parameters:
Name Type Description
count number

defaults to a random value between 1 and 3


<static> words(count)

randomWords

Parameters:
Name Type Description
count number

defaults to a random value between 1 and 3