create-n4-app
Version:
Create Next.js app with the n4 stack
26 lines (25 loc) • 622 B
JavaScript
export const getUserPackageName = () => {
const packageName = process.env.npm_config_user_agent;
if (packageName) {
if (packageName.startsWith("npm")) {
return {
depn: "npm",
nextIns: "npx",
};
}
else if (packageName.startsWith("bun")) {
return {
depn: "bun",
nextIns: "bunx",
};
}
}
else {
console.log("No package name specified | some thing is wrong");
process.exit(1);
}
return {
depn: "npm",
nextIns: "npx",
};
};