Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

package-manager-manager

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

package-manager-manager

Utilities for managing package managers.

  • 0.0.0-5141dc4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
67K
decreased by-3.76%
Maintainers
1
Weekly downloads
 
Created
Source

package-manager-manager

Utilities for managing package managers.


npm (tag) GitHub Workflow Status (with branch)


package-manager-manager is a library aimed at providing information regarding the package manager currently being used in a given project.

It can be used in CLIs or similar projects which may at some point need to know and adapt their behavior based on the package manager currently used by the developer (e.g. A project scaffolding tool, a bundling tool, etc...).

Usage

To use the library first install it in your project, via:

npm i package-manager-manager

(or your package manager's equivalent)

Then simply import and use the getPackageManager() function to get an object containing all the information you need regarding the package manager currently being used:

const packageManager = await getPackageManager();

console.log(packageManager.name);
// logs 'npm', 'yarn', 'pnpm' or 'bun'

console.log(packageManager.version);
// logs the version of the package manager e.g. '8.11.0'

Note Note that this library comes with properly defined and documented typescript types, meaning that once you obtain the PackageManager object you will be able to easily see what's available on it and get all necessary details directly in your IDE

FAQs

Package last updated on 13 Aug 2023

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