Skip to content

API Host BuiltInModules

liu.yandong.hanks edited this page Aug 23, 2026 · 1 revision

BuiltInModules

Catalog of native modules shipped with AuroraScript.

Namespace: AuroraScript.Runtime.Package. Kind: static class.

Back to .NET Host API Reference

Overview

Shipped native modules are explicit capabilities. EngineOptions.Default enables none of them. Select only the file-system or network access required by the application, then import the enabled bare path in script code.

using AuroraScript.Runtime.Package;

var options = EngineOptions.Default.WithBuiltIns(builtIns =>
{
    builtIns.Add(BuiltInModules.FileSystem);
    builtIns.Add(BuiltInModules.HttpClient);
});

Properties

FileSystem

static BuiltInModuleDefinition FileSystem

Enables the fs import and the APIs documented on fs.

import fs from "fs";

HttpClient

static BuiltInModuleDefinition HttpClient

Enables the http import and its synchronous and callback APIs documented on http.

import http from "http";

Resolution and Isolation

  • Enabled bare paths resolve before the configured project source resolver.
  • Relative imports such as ./fs and ../http continue to use project sources.
  • Built-in module sources are dependencies and are not enumerated as project entries by parameterless BuildAsync().
  • Module objects are isolated between engines and script domains.
  • Selecting a module on one EngineOptions instance does not enable it globally.

Both modules grant access outside the language runtime. Treat them as application capabilities, not harmless utility libraries; do not enable them for untrusted scripts without an appropriate process or operating-system sandbox.

Clone this wiki locally