mheob / used-pm

Detects what package manager executes the process

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

npm install used-pm

or

yarn add used-pm

or

pnpm add used-pm

or

bun add used-pm

Usage

In esm:

import currentPackageManager from 'used-pm';

const { name, version } = currentPackageManager();

In commonjs:

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

const { name, version } = currentPackageManager();

About

Detects what package manager executes the process

License:MIT License


Languages

Language:TypeScript 59.5%Language:JavaScript 31.0%Language:Shell 9.5%