Skip to content

script.library ​

Imports a JavaScript file from the MODLR filesystem, making its functions and variables available to the process.

Call it at the top of the script, outside pre(), begin(), data() and end(), so every function can use what it imports.

js
script.library(path)

Parameters ​

ParameterTypeDescription
pathstringThe file's path, from the root of the MODLR filesystem.

Examples ​

js
script.library('dimension-functions.js');

This imports dimension-functions.js from the root of the MODLR filesystem.