# @capgo/find-package-manager

> Find the package manager of a project

Latest version **0.0.18** (published 2025-07-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @capgo/find-package-manager
pnpm add @capgo/find-package-manager
yarn add @capgo/find-package-manager
bun add @capgo/find-package-manager
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.0.18 |
| Published | 2025-07-21 |
| First published | 2023-02-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.0.0 |
| Dependencies | 0 |
| Unpacked size | 5.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | github.com/riderx |
| Maintainers | riderx |
| Keywords | package manager, find, manager, pm |

## Links

- npm: https://www.npmjs.com/package/@capgo/find-package-manager
- Repository: https://github.com/Cap-go/find-package-manager
- Homepage: https://github.com/Cap-go/find-package-manager#readme
- Issues: https://github.com/Cap-go/find-package-manager/issues
- npm.io page: https://npm.io/package/@capgo/find-package-manager

## Recent versions

- 0.0.18 (latest) — 2025-07-21
- 0.0.17 — 2024-05-13
- 0.0.16 — 2024-05-10
- 0.0.15 — 2024-05-10
- 0.0.14 — 2024-05-10
- 0.0.13 — 2024-05-10
- 0.0.12 — 2024-05-10
- 0.0.11 — 2024-04-23
- 0.0.10 — 2024-02-10
- 0.0.9 — 2024-01-25
- 0.0.8 — 2024-01-25
- 0.0.7 — 2023-02-28
- 0.0.6 — 2023-02-28
- 0.0.5 — 2023-02-28
- 0.0.4 — 2023-02-28
- … 3 more at https://npm.io/package/@capgo/find-package-manager/versions

## README

# Find Package Manager Type
  <a href="https://capgo.app/"><img src='https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png' alt='Capgo - Instant updates for capacitor'/></a>

Find what package manager is used in the provided path.

```typescript
import { findPackageManagerType } from '@capgo/find-package-manager'

console.log(findPackageManagerType()) // npm | yarn | pnpm | bun | unknown
// Provide a path
console.log(findPackageManagerType('../.')) // npm | yarn | pnpm | bun | unknown
// Provide a default manager
console.log(findPackageManagerType('.', 'npm')) // npm | yarn | pnpm | bun
```

Find the install command for the package manager.

```typescript
import {  findInstallCommand } from '@capgo/find-package-manager'

console.log(findInstallCommand()) // install | add | unknown
// Provide the manager instead of read it with default folder '.'
console.log(findInstallCommand(findPackageManagerType())) // install | add | unknown
// Provide the manager and ask to return it prefixed
console.log(findInstallCommand(findPackageManagerType(), true)) // npm install | yarn add | pnpm add | bun add | unknown unknown
```

Find the package runner command.

```typescript
import { findPackageManagerRunner } from '@capgo/find-package-manager'

console.log(findPackageManagerRunner()) // 'yarn dlx' | 'npx' | 'bunx' | 'pnpm exec'
// Provide the path to search for
console.log(findPackageManagerRunner('../.')) // 'yarn dlx' | 'npx' | 'bunx' | 'pnpm exec'
// Provide a default manager
console.log(findPackageManagerRunner('.', 'yarn')) // 'yarn dlx' | 'npx' | 'bunx' | 'pnpm exec'
```

---
_Source: https://npm.io/package/@capgo/find-package-manager · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
