Socket
Socket
Sign inDemoInstall

preferred-pm

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

preferred-pm

Detects what package manager was used for installation


Version published
Weekly downloads
1.7M
decreased by-1.21%
Maintainers
1
Weekly downloads
 
Created

What is preferred-pm?

The preferred-pm npm package is designed to detect and suggest the preferred package manager for a given project. It checks for lock files such as package-lock.json, yarn.lock, or pnpm-lock.yaml to determine which package manager was previously used with the project and suggests using the same one for consistency.

What are preferred-pm's main functionalities?

Detecting preferred package manager

This feature allows you to detect the preferred package manager for the current project by analyzing the lock files present in the project directory. The code sample demonstrates how to use the package to find and log the preferred package manager.

const preferredPM = require('preferred-pm');

(async () => {
  const pm = await preferredPM(process.cwd());
  if (pm) {
    console.log(`The preferred package manager is ${pm.name}`);
  } else {
    console.log('No preferred package manager found');
  }
})();

Other packages similar to preferred-pm

Keywords

FAQs

Package last updated on 04 Jul 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc