ScriptProvider

@perion/script. ScriptProvider

A class used for provisioning script files

Constructor

new ScriptProvider(rootDir)

Source:

Returns a new instance of ScriptProvider

Parameters:
Name Type Default Description
rootDir string /scripts/

The root scripts directory

Methods

getFile(id, type) → {string}

Source:

Retrieves the requested script file (internal)

Parameters:
Name Type Description
id string

The file identifier (name)

type string

The type of script

Throws:
Error
Returns:

The JS file as a string

Type
string

getScript(request) → {string}

Source:

Retrieves the requested script file

Parameters:
Name Type Description
request string
Throws:
Error
Returns:

The JS file as a string

Type
string