Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 729 Bytes

scripting.md

File metadata and controls

27 lines (17 loc) · 729 Bytes

Process

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:

function test(name, t) {
  return `Hello [${name}] from [${t}] script`;
}

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