Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/mheob/used-pm

Detects what package manager executes the process
https://github.com/mheob/used-pm

hacktoberfest npm package-manager pnpm yarn

Last synced: 1 day ago
JSON representation

Detects what package manager executes the process

Awesome Lists containing this project

README

        

# `used-pm` - What package manager is used?

Lightweight script to detect which package manager executes the current process.

Currently, only the package manager `bun`, `npm`, `yarn` and `pnpm` are supported.

## Installation

Use your favorite package manager to install `used-pm`. For example:

```sh
npm install used-pm
```

or

```sh
yarn add used-pm
```

or

```sh
pnpm add used-pm
```

or

```sh
bun add used-pm
```

## Usage

In `esm`:

```js
import currentPackageManager from 'used-pm';

const { name, version } = currentPackageManager();
```

In `commonjs`:

```js
const currentPackageManager = require('used-pm');

const { name, version } = currentPackageManager();
```