UNPKG

create-n4-app

Version:
19 lines (18 loc) 530 B
export const getUserPackageName = () => { const packageName = process.env.npm_execpath; if (packageName) { if (packageName.startsWith("npm")) { return "npm"; } else if (packageName.startsWith("bun")) { return "bun"; } else if (packageName.startsWith("pnpm")) { return "pnpm"; } else if (packageName.startsWith("yarn")) { return "yarn"; } } return "npm"; // Default to "npm" if no match or undefined };