> ## Documentation Index
> Fetch the complete documentation index at: https://botmesh.afaya.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# isMainModule()

> Function exported by @botmesh/core.

```ts theme={null}
function isMainModule(meta): boolean;
```

Defined in: [dev/defineBot.ts:105](https://github.com/andresayac/botmesh/blob/main/packages/core/src/dev/defineBot.ts#L105)

Is the module that owns `meta` (pass `import.meta`) the process entry point,
i.e. was it started with `node <file>` rather than imported? Use it to guard
the "connect the real provider" block so `botmesh dev` (and your tests) can
import the factory without connecting to a real transport.

Uses `import.meta.main` when the runtime provides it (Node >= 22.18 / 24.2)
and otherwise compares the module's real path with `process.argv[1]`.

Caveat: process managers that `import()` your file from their own wrapper
(e.g. pm2 in ESM mode) make this `false`; point them at a tiny start file that
imports the factory and starts it instead.

## Parameters

| Parameter | Type | Description |
| - | - | - |
| `meta` | \{ `url`: `string`; `main?`: `boolean`; } | `import.meta` of the calling module. |
| `meta.url` | `string` | - |
| `meta.main?` | `boolean` | - |

## Returns

`boolean`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.