hook-builder-js.hoon library allows to run Tlon hooks written in JS. This document describes the API for it.
The interaction with the host environment is done in pseudo-CommonJS style: import Tlon hooks library by calling require("tlon_hooks"). No other packages are available in the hook-builder-js environment: bundle dependencies into a single file with JS bundlers if necessary.
hook-builder-js expects that the provided JS code will export a hook function to module.exports. Here is an example of a JS hook that passes through an event and releases no effects.