# parseNpmCmdShim

<!-- https://uncage.vercel.app/docs/api/agent/functions/parsenpmcmdshim/ -->

```ts
function parseNpmCmdShim(text): 
  | {
  target: string;
  viaNode: boolean;
}
  | null;
```

Defined in: protocol/dist/node.d.ts:66

Parses an npm `cmd-shim` `.cmd` file: the target after `%dp0%\` (or `%~dp0`) on the line that ends
with `%*`, and whether it is started through node (`"%_prog%"` / `node`). Null for anything else,
including a target that leaves the shim's folder (`..`).

## Parameters

| Parameter | Type |
| ------ | ------ |
| `text` | `string` |

## Returns

  \| \{
  `target`: `string`;
  `viaNode`: `boolean`;
\}
  \| `null`
