Absolute root directory.
Callback to call with Promise of completion.
Gets file contents.
Usage
// Load files
var grapefruitJuicer = Loader.getFile("c:\machines", "appliances", "grapefruitJuicer.txt");
// Output the result
grapefruitJuicer.then(function(result){ // grapefruitJuicer - on resolve
console.log(result);
}, function(error){ // grapefruitJuicer - on reject
console.error("Could not load a file.");
});
// Input - grapefruitJuicer.txt
// 1000W powerful juicer
// Output
// 1000W powerful juicer
Absolute root directory.
Directory relative to root.
Full file name.
File contents.
Checks if is a directory.
Usage
// Verify directory
Loader.isDir("c:\machines\appliances","grapefruitJuicer.txt").then(function(result){
console.log(result);
});
// Input - grapefruitJuicer.txt
// 1000W powerful juicer
// Output
// false
Absolute root directory.
Relative directory to root.
Returns true
if a directory, false
if not.
Checks if is a file
Usage
// Verify file
Loader.isFile("c:\machines\appliances\grapefruitJuicer.txt").then(function(result){
console.log(result);
});
// Input - grapefruitJuicer.txt
// 1000W powerful juicer
// Output
// true
Full filepath.
Returns true
if a file, false
if not.
Join a root directory with a file/folder or an array of files/folders to absolute path.
Usage
// Join and log result
console.log(Loader.join("c:\machines", "appliances"))
// Output
// c:\machines\appliances
File/folder name|names.
Absolute path|paths.
Returns an array of strings, representing the contents of a folder.
Usage
// List directory contents
Loader.list("c:","machines").then(function(result){
console.log(result);
}, function(error){
console.error("Folder not found.");
});
// Output
// ["machines", "appliances"]
Root directory.
Relative directory.
Array with contents; Rejects with errors from fs.readdir.
Extracts relative path from rootDir to target.
Usage
// Convert path and output the result
console.log(Loader.toRelative("c:\machines\refrigerators", "c:\machines\appliances"));
// Output
// ..\appliances
Source folder.
File/folder name|names.
Relative path|paths.
Converts YAML string to a JS object.
Usage
// Ouput conversion of YAML to JSON
console.log(Loader.yamlToObject("Wine: Red"));
// Output
// {"Wine": "Red"}
YAML string.
Javascript object.
Generated using TypeDoc
Required by system to perform file initialization.