Class: Path

Path()

Class for handling all things related to paths.

Constructor

new Path()

Source:

Methods

(static) createPath(newPath)

Creates the given path if it does not exist yet.
Parameters:
Name Type Description
newPath string The path which should be created.
Source:

(static) getSettingsFilePath() → {string}

Returns the path to the settings.json file.
Source:
Returns:
The path to the settings.json file.
Type
string

(static) getStoragePath() → {string}

Returns the path to the storage directory.
Source:
Returns:
The path to the storage directory.
Type
string

(static) home() → {string}

Returns the path to the user data directory. If the script is executed in the 'npm test' environment (i.e., the --tmpdir argument is provided), the path to the tmp directory is being returned.
Source:
Returns:
The path to the user data directory.
Type
string

(static) listJsonFiles(dir) → {array}

Returns all json files in a given directory.
Parameters:
Name Type Description
dir string The directory which contents we want to read.
Source:
Returns:
An array containing the names of all json files in the given directory.
Type
array

(static) moveJsonFiles(from, to, storage, callback)

Moves all json files from a source directory to a target directory.
Parameters:
Name Type Description
from string The source directory.
to string The target directory.
storage Storage Storage object to access the storage.
callback function Callback function which takes one boolean parameter that indicates whether the operation succeeded or not (true = success).
Source:

(static) sep() → {string}

Returns the path separator for the currently used operating system.
Source:
Returns:
The path separator for the currently used operating system.
Type
string