Skip to content

JavaScript/TypeScript Native Runtime Notes

Native backend hosts use role packages:

RolePackageMain API
Client@nnrp/native-clientClient API
Server@nnrp/native-serverServer API

TCP, QUIC, IPC, and WebSocket are not hidden inside the role packages. Install the corresponding @nnrp/transport-* packages for the carriers allowed to participate in selection.

Native FFI Binding

Role packages accept explicit FFI bindings for controlled deployments and tests. Packaged transport artifacts are owned by the transport packages.

NnrpNativeFfiBinding

PropertyTypeRequiredDescription
mode"native-addon" | "node-ffi" | "nano-ffi" | "test"NoBinding implementation label.
runtimeCapabilitiesfunctionNoReturns native runtime capability probe data.
submitResultCompactfunctionNoCoarse submit/result hot path.
submitNoWaitfunctionNoCoarse no-wait submit path.
cancelfunctionNoCoarse cancel path.
sendRuntimeFramefunctionNoRole-neutral coarse Preview4 frame send path.
submitRuntimeObjectLoopCompactfunctionNoBenchmark-only combined object loop helper.
awaitEventsfunctionNoCoarse batch event polling path.
closefunctionNoBinding cleanup hook.

Artifact Boundary

PackageNative artifact ownership
@nnrp/native-clientNone; client role only.
@nnrp/native-serverNone; server role only.
@nnrp/transport-tcpTCP native transport artifacts.
@nnrp/transport-quicQUIC native transport artifacts.
@nnrp/transport-ipcIPC native transport artifacts.
@nnrp/transport-websocketWebSocket native transport artifacts.

NNRP Documentation