columnify
columnify copied to clipboard
is it possible to color the title?
Related to topic of using colors in columnify using chalk as discussed in 26.
Is there a way to color the title? e.g.
var columnify = require('columnify');
var chalk = require('chalk');
var data = [{
bar: 'normal color string',
]};
data[chalk.red(foo)] = chalk.red('This is a red string');
console.log(columnify(data));
const columnify = require('columnify');
const chalk = require('chalk');
const data = [
{
name: 'some name',
value: 'some value'
},{
name: 'another name',
value: 'another value'
}
];
console.log(columnify(data, {
headingTransform: function(header){
return chalk.red(header.charAt(0).toUpperCase + header.slice(1).toLowerCase());
},
dataTransform: function(data){
return chalk.white(data);
}
}));