package-manager-manager
Advanced tools
Comparing version 0.0.0-18af871 to 0.0.0-1dd7c4b
@@ -1,2 +0,2 @@ | ||
export * from './utils'; | ||
export { getPackageManager } from './packageManager'; | ||
//# sourceMappingURL=index.d.ts.map |
20
index.js
@@ -1,5 +0,21 @@ | ||
import { isWindows as r } from "./utils/os.js"; | ||
import { getPackageManager as h } from "./packageManager.js"; | ||
import "shellac"; | ||
import "./commands/getRunScript.js"; | ||
import "./commands/getRunExec.js"; | ||
import "node:fs/promises"; | ||
import "node:path"; | ||
import "node:process"; | ||
import "./utils/locks.js"; | ||
import "./utils/yarn.js"; | ||
import "./package/index.js"; | ||
import "./package/bun.js"; | ||
import "./package/npm.js"; | ||
import "./package/shared.js"; | ||
import "./package/pnpm.js"; | ||
import "./package/yarn.js"; | ||
import "./utils/workspace.js"; | ||
import "./utils/cliCommands.js"; | ||
export { | ||
r as isWindows | ||
h as getPackageManager | ||
}; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "package-manager-manager", | ||
"version": "0.0.0-18af871", | ||
"version": "0.0.0-1dd7c4b", | ||
"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" | ||
}, | ||
@@ -49,10 +61,11 @@ "versionMetadata": { | ||
"scripts": { | ||
"build": "vite build && node ./scripts/build.js", | ||
"build": "vite build", | ||
"build:watch": "pnpm run build --watch", | ||
"lint": "eslint \"./**/*.{cjs,js,jsx,ts,tsx}\"", | ||
"prettier": "prettier --ignore-unknown --ignore-path=.gitignore --check .", | ||
"prettier:format": "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", | ||
"test": "vitest run", | ||
"test:watch": "vitest", | ||
"test": "vitest run --dir=tests", | ||
"test:watch": "vitest --dir=tests", | ||
"test:e2e": "vitest run --dir=e2e --no-threads", | ||
"test:coverage": "vitest run --coverage", | ||
@@ -59,0 +72,0 @@ "alter-version": "node ./scripts/alter-version.js", |
@@ -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'; | ||
export * from './yarn'; | ||
export * from './cliCommands'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -1,5 +0,17 @@ | ||
import { isWindows as r } from "./os.js"; | ||
import { isWindows as m } from "./os.js"; | ||
import { getProjectRootDir as s } from "./workspace.js"; | ||
import { isLockFile as l, lockFiles as x } from "./locks.js"; | ||
import { isYarnClassic as a } from "./yarn.js"; | ||
import { getPmCliCommandKeywords as n } from "./cliCommands.js"; | ||
import "node:fs/promises"; | ||
import "node:path"; | ||
import "node:process"; | ||
export { | ||
r as isWindows | ||
n as getPmCliCommandKeywords, | ||
s as getProjectRootDir, | ||
l as isLockFile, | ||
m as isWindows, | ||
a as isYarnClassic, | ||
x 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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 6 instances in 1 package
118264
111
886
48
2
14
11
1
+ Addedshellac@^0.8.0
+ Addedreghex@1.0.2(transitive)
+ Addedshellac@0.8.0(transitive)