Neuroscript Engine (JavaScript)
Use the WASM engine to power interactive docs and playgrounds that compile and run Neuroscript directly in the browser.
Recommended setup
- Build the WASM package with
wasm-pack. - Load the package with your bundler.
- Use
WasmEnginefor compile + run loops, orcompile_onlyfor validation-only flows.
For docs usage, copy the built package into docs/web/public/neuroscript-wasm so VitePress can serve it as a static asset.
Minimal playground loop
javascript
import init, { WasmEngine } from "neuroscript-wasm";
await init();
const engine = new WasmEngine(sourceEditor.value);
function run(event) {
return engine.runEvent(event, { bpm: 120, beat: 4_000_000 }, Date.now() * 1_000_000);
}Learn more
- JavaScript API for full event and transport shapes.
