createNodeAdapter
Generated reference page for the createNodeAdapter function export.
- Import:
@kjanat/dreamcli/runtime - Export kind: function
- Declared in:
src/runtime/node.ts - Source link:
packages/dreamcli/src/runtime/node.ts:177
Signatures
ts
function createNodeAdapter(proc?: NodeProcess): RuntimeAdapter;| Parameter | Type | Description |
|---|---|---|
proc | NodeProcess | undefined | Override the process object (useful for testing the adapter itself). |
Members
Members
createNodeAdapter
Create a runtime adapter backed by Node.js process globals.
Reads process.argv, process.env, process.cwd(), and wraps process.stdout.write/process.stderr.write as WriteFn functions.
Also works on Bun, which provides a Node-compatible process global.
ts
(proc?: NodeProcess): RuntimeAdapter;Examples
ts
import { cli } from '@kjanat/dreamcli';
import { createNodeAdapter } from '@kjanat/dreamcli/runtime/node';
cli('mycli')
.command(deploy)
.run({ adapter: createNodeAdapter() });