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 - npm Package Compare versions

Comparing version 0.0.0-26c5ff0 to 0.0.0-5141dc4

packageManager.cjs

2

index.d.ts

@@ -1,2 +0,2 @@

export * from './utils';
export { getPackageManager } from './packageManager';
//# sourceMappingURL=index.d.ts.map

@@ -1,5 +0,11 @@

import { isWindows as r } from "./utils/os.js";
import { getPackageManager as g } from "./packageManager.js";
import "shellac";
import "./utils/workspace.js";
import "node:fs/promises";
import "node:path";
import "node:process";
import "./utils/locks.js";
export {
r as isWindows
g as getPackageManager
};
//# sourceMappingURL=index.js.map
{
"name": "package-manager-manager",
"version": "0.0.0-26c5ff0",
"version": "0.0.0-5141dc4",
"description": "Utilities for managing package managers.",

@@ -11,9 +11,17 @@ "license": "MIT",

"import": "./index.js",
"require": "./index.cjs",
"types": "./index.d.ts"
"require": "./index.cjs"
}
},
"typesVersions": {
"*": {
"types": [
"./index.d.ts"
]
}
},
"publishConfig": {
"directory": "dist"
},
"main": "./index.js",
"types": "./index.d.ts",
"repository": {

@@ -30,6 +38,9 @@ "type": "git",

"@tsconfig/strictest": "^2.0.1",
"@types/mock-fs": "^4.13.1",
"@types/node": "^20.3.3",
"eslint": "^8.41.0",
"eslint": "^8.44.0",
"eslint-config-ixn": "^1.4.2",
"prettier": "^2.8.8",
"eslint-plugin-unicorn": "^48.0.1",
"mock-fs": "^5.2.0",
"prettier": "^3.0.0",
"typescript": "^5.0.4",

@@ -42,3 +53,4 @@ "vite": "^4.3.5",

"dependencies": {
"js-yaml": "^4.1.0"
"js-yaml": "^4.1.0",
"shellac": "^0.8.0"
},

@@ -52,4 +64,4 @@ "versionMetadata": {

"lint": "eslint \"./**/*.{cjs,js,jsx,ts,tsx}\"",
"prettier": "prettier --ignore-unknown --ignore-path=.gitignore --check .",
"prettier:fix": "prettier --ignore-unknown --ignore-path=.gitignore --write .",
"prettier": "prettier --ignore-unknown --ignore-path .gitignore --ignore-path .prettierignore --check .",
"prettier:fix": "prettier --ignore-unknown --ignore-path .gitignore --ignore-path .prettierignore --write .",
"tsc": "tsc --noEmit",

@@ -56,0 +68,0 @@ "test": "vitest run",

@@ -20,8 +20,29 @@ <p align="center">

**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
Add the library to your project.
To use the library first install it in your project, via:
```sh
npm add package-manager-manager
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:
```js
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
export * from './os';
export * from './workspace';
export * from './locks';
//# sourceMappingURL=index.d.ts.map

@@ -1,5 +0,13 @@

import { isWindows as r } from "./os.js";
import { isWindows as m } from "./os.js";
import { getProjectRootDir as s } from "./workspace.js";
import { isLockFile as f, lockFiles as l } from "./locks.js";
import "node:fs/promises";
import "node:path";
import "node:process";
export {
r as isWindows
s as getProjectRootDir,
f as isLockFile,
m as isWindows,
l as lockFiles
};
//# sourceMappingURL=index.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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