API reference › @evolu/nodejs
Modules
| Module | Description |
|---|---|
| TestBundle | Node.js utilities for testing production bundles. |
Interfaces
| Interface | Description |
|---|---|
| AvailableParallelismDep | Dependency wrapper for availableParallelism. |
| NodeJsRelayConfig | - |
| NodejsTime | Time with Node.js high-resolution nanosecond readings. |
| RunMainOptions | Options for runMain. |
| SpawnDep | Dependency wrapper for spawn. |
| SpawnError | Failure to start a command or an unsuccessful command exit. |
| TestSetupWebSocketUpgradeRequest | A raw WebSocket upgrade request prepared for tests by testSetupWebSocketUpgradeRequest. |
Type Aliases
| Type Alias | Description |
|---|---|
| AvailableParallelism | Returns the recommended amount of parallelism available to this process. |
| HrDuration | Elapsed nanoseconds measured using HrTime. |
| HrTime | Monotonic high-resolution timestamp in nanoseconds. |
| NodeSignal | A Node.js termination signal handled by runMain. |
| RelayDeps | - |
| RunMainMode | Process lifecycle behavior for runMain. |
| Spawn | Runs a command with inherited stdio. |
Variables
| Variable | Description |
|---|---|
| availableParallelism | Returns the recommended amount of parallelism available to this process. |
| createBetterSqliteDriver | - |
| createBroadcastChannel | Creates a BroadcastChannel from a Node.js BroadcastChannel. |
| spawn | Runs a command with inherited stdio and aborts it with the current Run. |
Functions
| Function | Description |
|---|---|
| createNodejsTime | Creates a NodejsTime using process.hrtime.bigint(). |
| createRelay | Creates an Evolu Relay server resource using Node.js. |
| createRelayDeps | Dependencies for createRelay using better-sqlite3. |
| createTimingSafeEqual | Creates the Node.js implementation of TimingSafeEqual. |
| hrDurationBetween | Returns the elapsed nanoseconds between two high-resolution timestamps. |
| hrDurationToMillis | Converts a high-resolution duration to the nearest millisecond. |
| millisToHrDuration | Converts milliseconds to an exact high-resolution duration. |
| testSendWebSocketUpgradeRequest | Sends a raw WebSocket upgrade request and resolves with the rejection response. |
| testSetupWebSocketUpgradeRequest | Creates a raw WebSocket upgrade request test setup for tests that need manual request control. |
Node.js Task
| Name | Description |
|---|---|
| NodeSignalAbortReason | An abort requested by a Node.js termination signal. |
| runMain | Runs the main Task as the Node.js program lifecycle. |