Runtime is a component that is responsible for running end user code in secure manner. It supports more or less latest ECMAScript standards, but it is not based on any existing runtime, such as that you would expect to find in browsers or in Node. The main reason why it is not based on any existing runtime is to enforce a strong security model. In other words when you copy JS/TS code that was written to work in a browser (using DOM APIs) or in Node environment (using Node modules such as
fs) it may not work in our runtime, because certain functions may not be available.
Standardised functions and classes:
- fetch (partial implementation, but all the essentials are implemented)
Custom non-standard functions (native to Horizon runtime):
- AbortProcess (custom error for indicating that the invocation needs to be aborted)
You can pull in additional functions in a form of utility libraries/packages.
More functions/object will be added over time when needed.
You can find the Runtime context TS definition file here.