index.js 309 B

123456789
  1. 'use strict';
  2. const userAgent = process.env.npm_config_user_agent;
  3. const isYarn = Boolean(userAgent && userAgent.startsWith('yarn'));
  4. const isNpm = Boolean(userAgent && userAgent.startsWith('npm'));
  5. module.exports.isNpmOrYarn = isNpm || isYarn;
  6. module.exports.isNpm = isNpm;
  7. module.exports.isYarn = isYarn;