API reference › @evolu/nodejs

Modules

ModuleDescription
TestBundleNode.js utilities for testing production bundles.

Interfaces

InterfaceDescription
AvailableParallelismDepDependency wrapper for availableParallelism.
NodeJsRelayConfig-
NodejsTimeTime with Node.js high-resolution nanosecond readings.
RunMainOptionsOptions for runMain.
SpawnDepDependency wrapper for spawn.
SpawnErrorFailure to start a command or an unsuccessful command exit.
TestSetupWebSocketUpgradeRequestA raw WebSocket upgrade request prepared for tests by testSetupWebSocketUpgradeRequest.

Type Aliases

Type AliasDescription
AvailableParallelismReturns the recommended amount of parallelism available to this process.
HrDurationElapsed nanoseconds measured using HrTime.
HrTimeMonotonic high-resolution timestamp in nanoseconds.
NodeSignalA Node.js termination signal handled by runMain.
RelayDeps-
RunMainModeProcess lifecycle behavior for runMain.
SpawnRuns a command with inherited stdio.

Variables

VariableDescription
availableParallelismReturns the recommended amount of parallelism available to this process.
createBetterSqliteDriver-
createBroadcastChannelCreates a BroadcastChannel from a Node.js BroadcastChannel.
spawnRuns a command with inherited stdio and aborts it with the current Run.

Functions

FunctionDescription
createNodejsTimeCreates a NodejsTime using process.hrtime.bigint().
createRelayCreates an Evolu Relay server resource using Node.js.
createRelayDepsDependencies for createRelay using better-sqlite3.
createTimingSafeEqualCreates the Node.js implementation of TimingSafeEqual.
hrDurationBetweenReturns the elapsed nanoseconds between two high-resolution timestamps.
hrDurationToMillisConverts a high-resolution duration to the nearest millisecond.
millisToHrDurationConverts milliseconds to an exact high-resolution duration.
testSendWebSocketUpgradeRequestSends a raw WebSocket upgrade request and resolves with the rejection response.
testSetupWebSocketUpgradeRequestCreates a raw WebSocket upgrade request test setup for tests that need manual request control.

Node.js Task

NameDescription
NodeSignalAbortReasonAn abort requested by a Node.js termination signal.
runMainRuns the main Task as the Node.js program lifecycle.