A module for utility functions.

Methods

(static) batches(path) → {Array}

A function to read the contents of a directory and to extract all files with the file extension *.json.

Parameters:
NameTypeDescription
pathString

A given path as string.

Returns:

Returns all JSON files contained in path.

Type: 
Array

(static) isDir(path) → {Boolean}

A function to check whether a path is a directory. This is a wrapper function for fs.lstatSync(path).isDirectory().

Parameters:
NameTypeDescription
pathString

A given path as string.

Returns:
Type: 
Boolean

(static) path(dir) → {String}

A function to check whether an absolute or relative path exists.

Parameters:
NameTypeDescription
dirString

A given path as string.

Returns:

Returns the path in case it exists. Returns null otherwise.

Type: 
String