forked from orbit-oss/chalk
Add chalk.stderr (#359)
This commit is contained in:
parent
6b4d20683f
commit
2a53389d72
9 changed files with 47 additions and 9 deletions
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
const ansiStyles = require('ansi-styles');
|
||||
const {stdout: stdoutColor} = require('supports-color');
|
||||
const {stdout: stdoutColor, stderr: stderrColor} = require('supports-color');
|
||||
const template = require('./templates');
|
||||
const {
|
||||
stringReplaceAll,
|
||||
|
|
@ -218,5 +218,9 @@ const chalkTag = (chalk, ...strings) => {
|
|||
|
||||
Object.defineProperties(Chalk.prototype, styles);
|
||||
|
||||
module.exports = Chalk(); // eslint-disable-line new-cap
|
||||
module.exports.supportsColor = stdoutColor;
|
||||
const chalk = Chalk(); // eslint-disable-line new-cap
|
||||
chalk.supportsColor = stdoutColor;
|
||||
chalk.stderr = Chalk({level: stderrColor ? stderrColor.level : 0}); // eslint-disable-line new-cap
|
||||
chalk.stderr.supportsColor = stderrColor;
|
||||
|
||||
module.exports = chalk;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue