detect-pm
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

detect-pm

Detect package managers automatically (npm, yarn, bun and pnpm).

detect-pm comes from https://github.com/antfu/install-pkg/blob/main/src/detect.ts. The author is antfu who is my super idol.

Installation

$ npm i detect-pm

$ yarn add detect-pm

$ pnpm add detect-pm

Usage

Support ES module and CommonJS:

import { detectPackageManager } from 'detect-pm'
// or
// const { detectPackageManager } = require('detect-pm')

detectPackageManager().then(pm => {
    console.log(pm) // one of npm, yarn, pnpm or bun if detect, else null
})

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i detect-pm

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

8.28 kB

Total Files

7

Last publish

Collaborators

  • w2xi