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

@capgo/find-package-manager

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capgo/find-package-manager - npm Package Compare versions

Comparing version 0.0.14 to 0.0.15

5

index.d.ts
export type PackageManagerType = 'yarn' | 'npm' | 'bun' | 'pnpm' | 'unknown';
export type InstallCommand = 'install' | 'add';
export function findPackageManagerType (path?: string, defaultPackageManager?: string): PackageManagerType;
export type PackageManagerRunner = 'yarn dlx' | 'npx' | 'bunx' | 'pnpm exec';
export function findPackageManagerType (path?: string, defaultPackageManager?: PackageManagerType): PackageManagerType;
export function findInstallCommand (packageManagerType?: PackageManagerType): InstallCommand;
export function findPackageManagerRuuner (path?: string, defaultPackageManagerRunner?: PackageManagerRunner);

@@ -39,2 +39,22 @@ import { existsSync } from 'fs';

}
export const findPackageManagerRuuner = (path = '.', defaultPackageManagerRunner = 'npx') => {
const bunPath = `${path}/bun.lockb`;
const pnpmPath = `${path}/pnpm-lock.yaml`;
const yarnPath = `${path}/yarn.lock`;
const npmPath = `${path}/package-lock.json`;
if (existsSync(bunPath)) {
return 'bunx'
}
if (existsSync(pnpmPath)) {
return 'pnpm exec'
}
if (existsSync(yarnPath)) {
return 'yarn dlx'
}
if (existsSync(npmPath)) {
return 'npx'
}
return defaultPackageManagerRunner
}
// console.log('findPackageManagerType', findPackageManagerType())

2

package.json

@@ -5,3 +5,3 @@ {

"public": true,
"version": "0.0.14",
"version": "0.0.15",
"license": "MIT",

@@ -8,0 +8,0 @@ "description": "Live update for capacitor apps",

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