Module: lib/utils

Utility module that contains various utility functions that are shared by the interactive interface and the default CLI interface.

Version:
  • 1.0.0
Author:
Source:

Methods

(static) convertNumber(number) → {number}

Converts a number like 100K to 100000.

Parameters:
Name Type Description
number string

The number to convert.

Source:
Throws:

Error when number is invalid.

Returns:

The converted number.

Type
number

(static) functions(source)

Prints the list of functions to STDOUT.

Parameters:
Name Type Description
source object

The JSON model to read from.

Source:

(async, static) generate(file, columns, options, headersopt)

Delegates the generation of random data.

Parameters:
Name Type Attributes Description
file string

The file to write to.

columns Array.<string>

An array of functions to run on each column.

options object

Options to pass the generator.

headers Array.<string> <optional>

An array of custom column headers.

Source:

(static) home() → {boolean}

Platform-dependent user home directory compatible on Windows and *nix systems that export $HOME.

Source:
Returns:

The path to the user's home directory.

Type
boolean

(static) listFunctions(source)

Generates an ASCII table from a JSON model.

Parameters:
Name Type Description
source object

The JSON model to read from.

Source: