isMainModule
Generated reference page for the isMainModule function export.
- Import:
@kjanat/dreamcli - Export kind: function
- Declared in:
src/core/cli/index.ts - Source link:
src/core/cli/index.ts:1727
Signatures
ts
function isMainModule(meta: ImportMeta): boolean;| Parameter | Type | Description |
|---|---|---|
meta | ImportMeta | The calling module's import.meta. |
Members
Members
isMainModule
Report whether the calling module is the process entrypoint, cross-runtime.
Node, Bun, and Deno set import.meta.main on the module invoked directly; projects with the runtime's ambient types can read that property directly. This helper is a compatibility form for projects whose tsconfig.json lib override drops those ImportMeta extras: passing import.meta whole avoids a direct .main access without requiring global augmentation.
ts
(meta: ImportMeta): boolean;Examples
ts
if (isMainModule(import.meta)) cli('mycli').command(deploy).run();