Node.js Integration
Use the direct Node-API JavaScript and TypeScript surface from the supported npm package.
Audience: Node.js integrators
Package boundary#
The supported npm identity is @wa120/ait-native. It contains the portable JavaScript and TypeScript facade and selects the exact RC.5 platform Node-API addon.
npm install @wa120/ait-native@1.0.0-rc.5The package does not bundle or start ait-server. Its API loads the package-owned addon directly and does not use a child process as the binding transport.
Direct API#
import { NativeRuntime } from "@wa120/ait-native";
const ait = new NativeRuntime();
console.log(ait.bindingInfo());
const status = ait.runCli(["status", "--json"]);
console.log(status);The packaged ait command calls the same native binding in process. The JavaScript API and command therefore share the admitted Rust behavior.
Repository workflow#
Node.js repositories use the same initialization and generated repository instructions as every other supported repository.
npx --no-install ait init
npx --no-install ait status --jsonAIT does not inspect package.json to choose test commands or framework behavior. The repository remains responsible for its explicit validation.
Platform packages#
Target-specific addon packages are exact-version implementation dependencies, not separate products. Applications should depend on the supported top-level package and let normal npm resolution select the matching addon.