mirror of
https://github.com/nodejs/node.git
synced 2025-05-11 16:21:27 +00:00

PR-URL: https://github.com/nodejs/node/pull/46881 Reviewed-By: Debadree Chatterjee <debadree333@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me>
26 lines
664 B
JavaScript
26 lines
664 B
JavaScript
'use strict';
|
|
|
|
module.exports = {
|
|
blue: '',
|
|
green: '',
|
|
white: '',
|
|
red: '',
|
|
gray: '',
|
|
clear: '',
|
|
hasColors: false,
|
|
refresh() {
|
|
if (process.stderr.isTTY) {
|
|
const hasColors = process.stderr.hasColors();
|
|
module.exports.blue = hasColors ? '\u001b[34m' : '';
|
|
module.exports.green = hasColors ? '\u001b[32m' : '';
|
|
module.exports.white = hasColors ? '\u001b[39m' : '';
|
|
module.exports.red = hasColors ? '\u001b[31m' : '';
|
|
module.exports.gray = hasColors ? '\u001b[90m' : '';
|
|
module.exports.clear = hasColors ? '\u001bc' : '';
|
|
module.exports.hasColors = hasColors;
|
|
}
|
|
},
|
|
};
|
|
|
|
module.exports.refresh();
|