API Reference

Scripts run in a sandboxed JavaScript environment with a set of built-in APIs. They come in two kinds:

  • Web APIs — globals, available in every script without importing anything
  • Modules — GearTrain-specific modules, imported by name when a script needs them

Each page documents what an API is for and how to use it. Where the implementation deviates from the related WHATWG/W3C standard, the exact differences are listed; every page also links to MDN and the underlying standard.

Modules

These modules are specific to GearTrain. Import them by name:

import fs from "fs";
import env from "env";

These modules are under active development. Their APIs may change between releases. Breaking changes are recorded in the changelog.

Web APIs

Globals, available in every script without importing: