# Function: detectPackageManager

▸ **detectPackageManager**(`dir?`): [`PackageManager`](../../devkit/documents/PackageManager)

Detects which package manager is used in the workspace based on the lock file.

#### Parameters

| Name  | Type     | Default value |
| :---- | :------- | :------------ |
| `dir` | `string` | `''`          |

#### Returns

[`PackageManager`](../../devkit/documents/PackageManager)
