Overview
ThecreateModuleMap() function provides a Node.js compatibility layer, allowing you to use familiar Node.js modules in the runtime environment.
createModuleMap()
Creates a map of Node.js-compatible modules that can be dynamically loaded.Signature
Parameters
- ctx
NodeContext- Runtime context containing:vfs- Virtual file systemcwd- Current working directoryenv- Environment variablesstdout/stderr- Output streamsargv- Command-line argumentsfilename/dirname- Current file pathssignal- Abort signalexecuteCapture- Command execution function (optional)portRegistry- HTTP port registry (optional)