index.js 470 B

123456789101112131415161718192021
  1. 'use strict';
  2. const chalk = require('chalk');
  3. const isSupported = process.platform !== 'win32' || process.env.CI || process.env.TERM === 'xterm-256color';
  4. const main = {
  5. info: chalk.blue('ℹ'),
  6. success: chalk.green('✔'),
  7. warning: chalk.yellow('⚠'),
  8. error: chalk.red('✖')
  9. };
  10. const fallbacks = {
  11. info: chalk.blue('i'),
  12. success: chalk.green('√'),
  13. warning: chalk.yellow('‼'),
  14. error: chalk.red('×')
  15. };
  16. module.exports = isSupported ? main : fallbacks;