utils

Utility functions for the Voxel51 Vision Services API.

Copyright 2017-2018, Voxel51, LLC
voxel51.com

Source:

Classes

Serializable
APITimeoutError

Methods

readJSON(path) → {object}

Reads JSON from file.

Parameters:
Name Type Description
path string

the path to a JSON file

Source:

JSONToStr(obj) → {string}

Generates a string representation of the JSON object.

Parameters:
Name Type Description
obj object

an object that can be directly dumped to a JSON file

Source:

writeJSON(obj, path)

Writes JSON object to file, creating the output directory if necessary.

Parameters:
Name Type Description
obj object

an object that can be directly dumped to a JSON file

path string

the output path

Source:

copyFile(inPath, outPath)

Copies the input file to the output location, creating the output directory if necessary.

Parameters:
Name Type Description
inPath string

the input file

outPath string

the output file location

Source:

ensureBaseDir(filePath)

Makes the base directory of the given path, if necessary.

Parameters:
Name Type Description
filePath string

a file path

Source: