lix-website/themes/lix/assets/bootstrap/node_modules/is-npm/index.js
2024-04-26 22:49:34 -06:00

12 lines
456 B
JavaScript

'use strict';
const packageJson = process.env.npm_package_json;
const userAgent = process.env.npm_config_user_agent;
const isYarn = Boolean(userAgent && userAgent.startsWith('yarn'));
const isNpm = Boolean(userAgent && userAgent.startsWith('npm'));
const isNpm7 = Boolean(packageJson && packageJson.endsWith('package.json'));
module.exports.isNpmOrYarn = isNpm || isNpm7 || isYarn;
module.exports.isNpm = isNpm || isNpm7;
module.exports.isYarn = isYarn;