Gathering detailed insights and metrics for detect-package-manager
Gathering detailed insights and metrics for detect-package-manager
Gathering detailed insights and metrics for detect-package-manager
Gathering detailed insights and metrics for detect-package-manager
Detect which package manager you're using (yarn or pnpm or npm)
npm install detect-package-manager
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
74 Stars
20 Commits
7 Forks
4 Watching
2 Branches
4 Contributors
Updated on 08 Oct 2024
TypeScript (100%)
Cumulative downloads
Total Downloads
Last day
-2.6%
584,265
Compared to previous day
Last week
3.6%
3,019,047
Compared to previous week
Last month
4.4%
12,846,265
Compared to previous month
Last year
15.3%
201,413,782
Compared to previous year
1
6
yarn.lock
, package-lock.json
, pnpm-lock.yaml
, or bun.lockb
in current working directory, it will skip other operations and directly resolve yarn
, npm
, pnpm
, or bun
.yarn
, pnpm
, or bun
command exists. If so, it resolves yarn
, pnpm
, or bun
otherwise npm
.1yarn add detect-package-manager
1const { detect } = require("detect-package-manager"); 2 3detect().then((pm) => { 4 console.log(pm); 5 //=> 'yarn', 'npm', or 'pnpm', 'bun' 6});
opts.cwd
: string
Optional, defaults to .
, the directory to look up yarn.lock
, package-lock.json
, or pnpm-lock.yaml
.opts.includeGlobalBun
: boolean
Optional, defaults to false
, whether to check if bun
exists in PATH.Promise<PM>
It returns a Promise resolving the name of package manager, could be npm
, yarn
, or pnpm
, bun
.
pm
: string
Optional, defaults to npm
, could be npm
, yarn
, or pnpm
, bun
Promise<string>
It returns a Promise resolving the version of npm or the package manager you specified.
void
Clear cache.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
detect-package-manager © EGOIST, Released under the MIT License.
Authored and maintained by EGOIST with help from contributors (list).
github.com/egoist · GitHub @EGOIST · Twitter @_egoistlily
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
Found 3/20 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
10 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More