Module: json-timeline

CLI for generating Timelines
Parameters:
Name Type Description
adventsPath string Path to Advents Directory
outputPath string Path to Output Directory
flags string Flags: v = verbose, f = force
Source:

Members

(inner, constant) FLAGS :Object

Boolean flags for CLI Argument flags
Type:
  • Object
Source:

Methods

(inner) checkAdventsDirectory(adventsPath) → {string}

Check if the Advents Input Path is an Existing Directory
Parameters:
Name Type Description
adventsPath string Advents Input Path
Source:
Throws:
An Error if the Advents Input Path is not an Existing Directory
Returns:
Advents Path
Type
string

(inner) checkAdventsDirectory(outputPath) → {string}

Check and Make a Directory of the Output Input Path
Parameters:
Name Type Description
outputPath string Output Input Path
Source:
Throws:
An Error if the Output Input Path Exists but is not a Directory
Returns:
Output Path
Type
string

(inner) copyFile(sourcePath, destPath)

Copies Source File to Destination File
Parameters:
Name Type Description
sourcePath string Path to Source File
destPath string Path to Destination File
Source:

(inner) handleArguments(args) → {Array.<string>}

Handles CLI Arguments for Paths and Flags
Parameters:
Name Type Description
args Array.<string> [advents, output, flags] CLI arguments
Source:
Throws:
An Error if advents or output are undefined
Returns:
Advents and Output Paths
Type
Array.<string>

(inner) processAdvents(adventsPath) → {string}

Process and Return Advents from Advents Directory
Parameters:
Name Type Description
adventsPath string Advents Path
Source:
Throws:
An Error if failed to load Advents
Returns:
advents.js File Contents
Type
string

(inner) str(input) → {string}

Wrapper for consistent JSON.stringify
Parameters:
Name Type Description
input * Input Argument
Source:
Returns:
Stringified Input
Type
string

(inner) vLog(message, opts)

Log a message with Level based on Verbose
Parameters:
Name Type Description
message string Message to Log
opts Object Options for Level and Verbose
Source:

(inner) writeAdvents(destPath, content)

Write advents.js content to Destination File
Parameters:
Name Type Description
destPath string Destination Path
content string Content to write to Destination File
Source:
Throws:
An Error if the Destination Path is not a file

(inner) writeViewFiles(outputPath)

Write files in view/ to Output Directory, overwriting if the force flag is true
Parameters:
Name Type Description
outputPath string Output Path
Source:
Throws:
An Error if an Output Destination File Path is not a file