Util
Class holding the frequently used functions.
Method Summary
Public Methods | ||
public |
Create the temporary directory. |
|
public |
executeCommand(cmd: String): Promise Execute a command from within the root folder. |
|
public |
exportCollection(collection: String): Promise Export a collection to a JSON file. |
|
public |
importCollection(collection: String, jsonFile: String): Promise Import a json file to a collection. |
|
public |
Error logger function. |
|
public |
resetLog() Reset the default log file. |
|
public |
Search for a key in an array of object. |
|
public |
setLastUpdated(updated: String) Updates the |
|
public |
Updates the |
Private Methods | ||
private |
_createEmptyFile(path: String) Create an emty file. |
|
private |
_resetTemp(tmpPath: String) Removes all the files in the temporary directory. |
Public Methods
public executeCommand(cmd: String): Promise source
Execute a command from within the root folder.
Params:
Name | Type | Attribute | Description |
cmd | String | The command to execute. |
public exportCollection(collection: String): Promise source
Export a collection to a JSON file.
Params:
Name | Type | Attribute | Description |
collection | String | The collection to export. |
public importCollection(collection: String, jsonFile: String): Promise source
Import a json file to a collection.
public onError(errorMessage: String): Error source
Error logger function.
Params:
Name | Type | Attribute | Description |
errorMessage | String | The error message you want to display. |
public setLastUpdated(updated: String) source
Updates the lastUpdated.json
file.
Params:
Name | Type | Attribute | Description |
updated | String |
|
The epoch time when the API last started scraping. |
public setStatus(status: String) source
Updates the status.json
file.
Params:
Name | Type | Attribute | Description |
status | String |
|
The status which will be set to in the |