postinstall.js 1.0 KB

1234567891011121314151617181920212223
  1. /* eslint-disable max-len */
  2. var env = process.env;
  3. var ADBLOCK = is(env.ADBLOCK);
  4. var CI = is(env.CI);
  5. var COLOR = is(env.npm_config_color);
  6. var SILENT = !!~['silent', 'error', 'warn'].indexOf(env.npm_config_loglevel);
  7. function is(it) {
  8. return !!it && it !== '0' && it !== 'false';
  9. }
  10. function log(it) {
  11. // eslint-disable-next-line no-console,no-control-regex
  12. console.log(COLOR ? it : it.replace(/\u001B\[\d+m/g, ''));
  13. }
  14. if (!ADBLOCK && !CI && !SILENT) {
  15. log('\u001B[96mThank you for using core-js (\u001B[94m https://github.com/zloirock/core-js \u001B[96m) for polyfilling JavaScript standard library!\u001B[0m\n');
  16. log('\u001B[96mThe project needs your help! Please consider supporting of core-js on Open Collective or Patreon: \u001B[0m');
  17. log('\u001B[96m>\u001B[94m https://opencollective.com/core-js \u001B[0m');
  18. log('\u001B[96m>\u001B[94m https://www.patreon.com/zloirock \u001B[0m\n');
  19. log('\u001B[96mAlso, the author of core-js (\u001B[94m https://github.com/zloirock \u001B[96m) is looking for a good job -)\u001B[0m\n');
  20. }