3.2.0 • Published 2 years ago
@node-kit/which-pm v3.2.0
@node-kit/which-pm
A simple utility to get which package manager used in the project
Install
# use pnpm
$ pnpm install -D @node-kit/which-pm
# use yarn
$ yarn add -D @node-kit/which-pm
# use npm
$ npm install -D @node-kit/which-pm
Usage
use @node-kit/which-pm
in terminal
npx which-pm
# output: pnpm@7.26.1 | null
use import
import { whichPM, whichPMSync } from '@node-kit/which-pm'
whichPM()
// or
whichPMSync()
use require
const { whichPM, whichPMSync } = require('@node-kit/which-pm')
whichPM()
// or
whichPMSync()
API reference
- Usage:
whichPM([cwd, withVersion])
&whichPMSync([cwd, withVersion])
- Parameters:
Param | Description | Type | Optional value | Required | Default value |
---|---|---|---|---|---|
cwd | running path | string | - | false | - |
withVersion | return with version | boolean | - | false | true |
- Types:
declare function whichPM(cwd?: string, withVersion?: boolean): Promise<string | null>
declare function whichPMSync(cwd?: string, withVersion?: boolean): string | null
- Demos:
- simple use
import { whichPM, whichPMSync } from '@node-kit/which-pm'
whichPM().then(path => {
console.log('The package manager is: ', path) // pnpm@7.26.1 | null
})
console.log('The package manager is: ', whichPMSync()) // pnpm@7.26.1 | null
Issues & Support
Please open an issue here.
License
3.0.0-beta.3
2 years ago
3.0.0-beta.2
2 years ago
3.0.0-beta.5
2 years ago
3.0.0-beta.4
2 years ago
3.2.0
2 years ago
3.1.1
2 years ago
3.1.0
2 years ago
3.0.0
2 years ago
2.3.0
2 years ago
2.5.0
2 years ago
2.4.0
2 years ago
2.5.1
2 years ago
2.2.1
2 years ago
2.2.0
2 years ago
2.0.0-beta.1
2 years ago
2.1.0
2 years ago
2.0.0
2 years ago
1.3.4
2 years ago
1.3.3
2 years ago
1.3.2
2 years ago
1.3.1
2 years ago
1.3.0
2 years ago
1.3.0-beta.1
2 years ago
1.2.1
2 years ago
1.2.0
2 years ago
1.1.0
2 years ago
1.0.0-alpha.8
2 years ago
1.0.0-alpha.7
2 years ago
1.0.0-alpha.6
2 years ago
1.0.0-alpha.4
2 years ago
1.0.0-alpha.3
2 years ago
1.0.0-alpha.2
2 years ago