Documentation menu
API referenceMarkdown ↗

Application lifecycle

On this page
API reference0.1.0-alpha.27

Runtime lifecycle notifications for supervised applications. Module evaluation and application readiness are separate events; readiness means the application has finished its own startup work.

Import from maligator:application. This API is experimental. Load declarations as described in Use TypeScript. Platform imports do not require a surface flag. Call ready() when your application has completed startup. Use it in development after opening the listener or other resource you own. Readiness and module evaluation are separate events. The supervisor notification does not perform a port reservation or traffic handoff.

ready

Notify the development supervisor that this application is ready. Repeated calls are harmless. Returns true in a supervised application and false in a standalone application or ordinary worker. Call after resources such as a server listener are accepting work; this does not reserve ports or transfer traffic.

typescript
export const ready: () => boolean;
typescript
import { ready } from "maligator:application";
import { createServer } from "node:http";

createServer((_request, response) => response.end("hello")).listen(3000, () => ready());
Maligator 0.1.0-alpha.27 · Experimental · Source 96c331078104
Edit this page · Compatibility

Search guides and API reference.

Browse the API · Troubleshooting