Scripting

Allows the execution of JavaScript files using a built-in interpreter

This is a module for Project Forge. It allows the execution of JavaScript files using a built-in interpreter.

https://github.com/kyleu/projectforge/tree/master/module/scripting

License

Licensed under CC0

Usage

Create a new Script service by calling scripting.NewService(filesystem.NewService("./data"), "scripts").

A UI is provided for ad-hoc scripting and filesystem management.

Your scripts can expose test case examples that will automatically be run:

1
2
3
4
5
6
7
function test(name, t) {
return `Hello [${name}] from [${t}] script`;
}

const examples = {
"test": [["a", "x"], ["b", "y"], ["c", "z"]]
};

Technology