An open API service indexing awesome lists of open source software.

https://github.com/nitayneeman/vscode-package-manager-detector

๐Ÿ”Ž A Visual Studio Code extension which detects and displays which package manager (npm, yarn, pnpm or bun) is used in your project
https://github.com/nitayneeman/vscode-package-manager-detector

bun npm package-manager pnpm visual-studio-code vscode yarn

Last synced: 2 months ago
JSON representation

๐Ÿ”Ž A Visual Studio Code extension which detects and displays which package manager (npm, yarn, pnpm or bun) is used in your project

Awesome Lists containing this project

README

          

VS Code - Package Manager Detector


Marketplace
Build
Installs
License


Installation ยท
Usage ยท
Settings ยท
CHANGELOG

## โ„น๏ธ๏ธ Description

This Visual Studio Code extension automatically detects and displays which package manager (npm, yarn, pnpm, or bun) is used in your project. It shows the detected package manager in the status bar with color-coded indicators and provides quick access to package.json.


Preview

The extension intelligently detects package managers by analyzing:

- Lock files (`package-lock.json`, `yarn.lock`, `pnpm-lock.yaml`, `bun.lockb`)
- The `packageManager` field in `package.json`
- Priority-based detection when multiple lock files exist


## ๐Ÿ‘จ๐Ÿปโ€๐Ÿซ How to Use

The first thing you need to do is installing the [extension](https://marketplace.visualstudio.com/items?itemName=nitayneeman.package-manager-detector).

The extension automatically detects your package manager when you open a workspace and displays it in the status bar with color-coded text (all lowercase):

- **npm** - Red (`#CB3837`)
- **yarn** - Blue (`#2C8EBB`)
- **pnpm** - Orange (`#F9AD00`)
- **bun** - Beige (`#FBF0DF`)

Hover over the status bar item to see:

- Package manager name and version (from `packageManager` field)
- Total dependency count
- Available npm scripts with their commands
- Click to open `package.json`

### Detection Priority

The extension follows this detection priority:

1. **Lock Files** (highest priority)

- `bun.lockb` โ†’ bun
- `pnpm-lock.yaml` โ†’ pnpm
- `yarn.lock` โ†’ yarn
- `package-lock.json` โ†’ npm

2. **packageManager Field** (fallback)

- Parses the `packageManager` field in `package.json`
- Examples: `"packageManager": "pnpm@8.6.0"` โ†’ pnpm


## โš™๏ธ Settings

The extension allows you to customize the following configuration settings:

| Name | Description | Default |
| ----------------------------- | -------------------------------- | --------- |
| `packageManagerDetector.npm` | Color for npm in the status bar | `#CB3837` |
| `packageManagerDetector.yarn` | Color for yarn in the status bar | `#2C8EBB` |
| `packageManagerDetector.pnpm` | Color for pnpm in the status bar | `#F9AD00` |
| `packageManagerDetector.bun` | Color for bun in the status bar | `#FBF0DF` |

### Customize Colors

You can customize the colors in your VS Code settings:

```json
{
"workbench.colorCustomizations": {
"packageManagerDetector.npm": "#CC0000",
"packageManagerDetector.yarn": "#0066CC",
"packageManagerDetector.pnpm": "#FF9900",
"packageManagerDetector.bun": "#FFF5E1"
}
}
```


## ๐Ÿ’๐Ÿป Contributing

This is an open source project. Any contribution would be greatly appreciated!