UNPKG

@selemondev/create-react-next

Version:

The Next Generation React Scaffolding Tool ✨

23 lines (19 loc) 547 B
export type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun' export const getPackageManager = (): PackageManager => { const userAgent = process.env.npm_config_user_agent || ''; if (userAgent) { if (userAgent.startsWith('npm')) { return 'npm' }; if (userAgent.startsWith('yarn')) { return "yarn" } if (userAgent.startsWith('pnpm')) { return "pnpm" } if (userAgent.startsWith('bun')) { return "bun" } } return 'npm' }