Skip to content

createNodeAdapter

Generated reference page for the createNodeAdapter function export.

Signatures

ts
function createNodeAdapter(proc?: NodeProcess): RuntimeAdapter;
ParameterTypeDescription
procNodeProcess | undefinedOverride 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() });

See Also

Released under the MIT License.