x-con
v4.0.1
Published
convenience methods for process.stdout and chalk
Downloads
5
Readme
#x-con
(extended console)
This is basicaly just convenience methods for process.stdout and chalk.
// background colors:
// black
// red
// green
// yellow
// blue
// magenta
// cyan
// white
// blackbright
// redbright
// greenbright
// yellowbright
// bluebright
// magentabright
// cyanbright
// whitebright
// hex value support added in 4.0.1
const xcon = require('./index.js');
const con = require('funccon');
let arbitraryCounter = 0;
const step = () => {
arbitraryCounter++;
return arbitraryCounter;
};
con({
size:1,
funcs:[
(complete)=>{
xcon.post([{
txt: ` -- ${step()} -- `
}, {
txt: ` -- ${step()} -- `,
color: '#00ff00',
bg: 'green',
bold: true
}, {
txt: ` -- ${step()} -- `,
color: '#00ff00',
bg: 'red',
bold: true
}, {
txt: `\n`
}, {
txt: ` -- ${step()} -- `
}, {
txt: ` -- ${step()} -- `,
color: '#00ff00',
bg: '#333333',
bold: true
}, {
txt: ` -- ${step()} -- `,
color: '#00ff00',
bg: 'red',
bold: true
}, {
txt: `\n`
}, {
txt: ` -- ${step()} -- `
}, {
txt: ` -- ${step()} -- `,
color: '#00ff00',
bg: 'blue',
bold: true
}, {
txt: ` -- ${step()} -- `,
color: '#00ff00',
bg: 'red',
bold: true
}, {
txt: `\n`
}
],() => {
xcon.back();
xcon.up(3);
setTimeout(function(){
complete();
},2000);
});
},
(complete)=>{
xcon.post([{
txt: ` -- ${step()} -- `
}, {
txt: ` -- ${step()} -- `,
color: '#00ff00',
bg: 'blue',
bold: true
}, {
txt: ` -- ${step()} -- `,
color: '#00ff00',
bg: 'red',
bold: true
}, {
txt: `\n`
}, {
txt: ` -- ${step()} -- `
}, {
txt: ` -- ${step()} -- `,
color: '#00ff00',
bg: 'blue',
bold: true
}, {
txt: ` -- ${step()} -- `,
color: '#00ff00',
bg: 'red',
bold: true
}, {
txt: `\n`
}, {
txt: ` -- ${step()} -- `
}, {
txt: ` -- ${step()} -- `,
color: '#00ff00',
bg: 'blue',
bold: true
}, {
txt: ` -- ${step()} -- `,
color: '#00ff00',
bg: 'red',
bold: true
}, {
txt: `\n`
}
],() => {
setTimeout(function(){
complete();
},2000);
});
}
],
done:()=>{
console.log('demo done!');
}
});