mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-20 15:30:39 +01:00
feat: remove colors in favour of chalk (#10142)
* feat: remove colors in favour of chalk * fix: bad conversion from colors to chalk in src/cli/index.js * fix: padWidth calculation to account for control characters * fix: termWidth calculation, but swapped one problem for another * fix: formatItem, implement my own padRight to take control characters into account
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
const colors = require('colors/safe');
|
||||
const nconf = require('nconf');
|
||||
const validator = require('validator');
|
||||
const querystring = require('querystring');
|
||||
const _ = require('lodash');
|
||||
const chalk = require('chalk');
|
||||
|
||||
const translator = require('../translator');
|
||||
const user = require('../user');
|
||||
@@ -451,7 +451,7 @@ helpers.formatApiResponse = async (statusCode, res, payload) => {
|
||||
|
||||
if (global.env === 'development') {
|
||||
returnPayload.stack = payload.stack;
|
||||
process.stdout.write(`[${colors.yellow('api')}] Exception caught, error with stack trace follows:\n`);
|
||||
process.stdout.write(`[${chalk.yellow('api')}] Exception caught, error with stack trace follows:\n`);
|
||||
process.stdout.write(payload.stack);
|
||||
}
|
||||
res.status(statusCode).json(returnPayload);
|
||||
|
||||
Reference in New Issue
Block a user