Utils

Methods

static createDB(path)

Initialise NeDB in path

Parameters:
Name Type Description
path string

static isPlayable(file) → {boolean}

Return true if file is playable

Parameters:
Name Type Description
file string

the filename with extension

Returns:
boolean -
  • if its playable or not.

static sendFile(dlPath)

Create HTTP server to send videos to the client.

Parameters:
Name Type Description
dlPath string

Root directory where all downloads reside.

static titleCase(str) → {string}

Turn str into Title Case and return it.

Parameters:
Name Type Description
str string

the string to transform

Returns:
string -
  • Title Cased string

inner getFileExtension(file) → {string}

Get the extension of {file}

Parameters:
Name Type Description
file string

the file name / path

Returns:
string -
  • extension of the file.

inner isVideo(file) → {boolean}

Checks whether the file path is playable video

Parameters:
Name Type Description
file string

the path to the file

Returns:
boolean -

true for playable, false for not.