createAdapter
Generated reference page for the createAdapter function export.
- Import:
@kjanat/dreamcli/runtime - Export kind: function
- Declared in:
src/runtime/auto.ts - Source link:
packages/dreamcli/src/runtime/auto.ts:86
Signatures
ts
function createAdapter(globals?: GlobalForDetect): RuntimeAdapter;| Parameter | Type | Description |
|---|---|---|
globals | GlobalForDetect | undefined | Override globalThis for testing. Production callersshould omit this parameter. |
Members
Members
createAdapter
Create a runtime adapter for the current environment.
Detection order follows detectRuntime: Bun → Deno → Node → unknown. Unknown runtimes fall back to the Node adapter because most JS runtimes expose a Node-compatible process global.
ts
(globals?: GlobalForDetect): RuntimeAdapter;Examples
ts
import { cli } from '@kjanat/dreamcli';
// Auto-detects Node/Bun/Deno and creates the right adapter
cli('mycli').run(); // uses createAdapter() internally