get-package-manager
Advanced tools
| declare function getPackageManager(pkg?: { | ||
| prefer: string; | ||
| }): string; | ||
| export { getPackageManager }; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| Object.defineProperty(exports,"__esModule",{value:!0}),exports.getPackageManager=void 0;const e=require("shelljs");function n(n){return 0===(0,e.exec)(`${n} > /dev/null 2>&1`).code}exports.getPackageManager=function(e){const r=e?.prefer||"";switch(!0){case r&&n(`${r} --version`):return r;case n("npm --version"):return"npm";case n("yarn --version"):return"yarn";case n("pnpm --version"):return"pnpm";default:return"Unknown"}}; | ||
| "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getPackageManager=void 0;const e=require("shelljs");function r(r){return 0===(0,e.exec)(`${r} > /dev/null 2>&1`).code}exports.getPackageManager=function(e){const n=e?.prefer||"";switch(!0){case n&&r(`${n} --version`):return n;case r("npm --version"):return"npm";case r("yarn --version"):return"yarn";case r("pnpm --version"):return"pnpm";default:return"Unknown"}}; |
+5
-7
| { | ||
| "name": "get-package-manager", | ||
| "version": "1.0.2", | ||
| "version": "1.0.3", | ||
| "main": "dist/index.js", | ||
| "module": "dist/index.es.js", | ||
| "description": "Get installed node package manager", | ||
| "types": "dist/es/index.d.ts", | ||
| "types": "dist/index.d.ts", | ||
| "license": "MIT", | ||
| "files": [ | ||
| "dist/index.es.js", | ||
| "dist/index.js", | ||
| "dist/es/index.d.ts", | ||
| "dist/es/types.d.ts" | ||
| "dist/*" | ||
| ], | ||
@@ -21,3 +18,3 @@ "scripts": { | ||
| "coveralls": "jest --coverage && cat ./coverage/lcov.info | coveralls", | ||
| "build": "rimraf dist && tsc -p tsconfig.json && tsc -p tsconfig-es.json && rollup -c --environment INCLUDE_DEPS,BUILD:production" | ||
| "build": "rimraf out && rimraf dist && tsc -p tsconfig.json && tsc -p tsconfig-es.json && rollup -c --environment INCLUDE_DEPS,BUILD:production" | ||
| }, | ||
@@ -61,2 +58,3 @@ "repository": { | ||
| "rollup": "^2.63.0", | ||
| "rollup-plugin-dts": "^4.1.0", | ||
| "rollup-plugin-peer-deps-external": "^2.2.4", | ||
@@ -63,0 +61,0 @@ "rollup-plugin-terser": "^7.0.2", |
| import { Prefer } from './types'; | ||
| export declare function getPackageManager(pkg?: Prefer): string; |
| export interface Prefer { | ||
| prefer: string; | ||
| } |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
4053
-1.58%22
4.76%5
-16.67%8
-11.11%