Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
The 'which-pm' npm package is designed to detect which package manager was used to install the current project. This can be particularly useful in environments where multiple package managers (like npm, yarn, or pnpm) might be used across different projects. It helps in scripting and automation by allowing the script to adapt based on the package manager used.
Detect package manager
This feature allows you to detect which package manager was used for the current project. The function takes the current working directory as an argument and returns a promise that resolves with the name of the package manager.
const whichPM = require('which-pm');
whichPM(process.cwd()).then(pm => {
console.log(`This project uses ${pm.name}`);
});
Similar to 'which-pm', 'check-package-manager' also checks and validates the package manager used in a project. However, it focuses more on ensuring that the correct package manager is used based on a configuration file, rather than just detecting it.
While 'npm-which' is designed to locate the binaries of locally installed npm packages, it serves a different purpose but is similar in the sense that it helps in identifying tools related to npm. It does not detect the package manager but locates npm package binaries.
Detects what package manager was used for installation
Can detect npm, pnpm and yarn.
<pnpm|yarn|npm> add which-pm
'use strict'
const whichpm = require('which-pm')
whichpm(process.cwd())
.then(pm => console.log(pm))
.catch(err => console.error(err))
//> {name: "pnpm", version: "0.64.2"}
FAQs
Detects what package manager was used for installation
The npm package which-pm receives a total of 1,386,589 weekly downloads. As such, which-pm popularity was classified as popular.
We found that which-pm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.