x-con

4.0.1 • Public • Published

#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!');
		}
	});

Readme

Keywords

none

Package Sidebar

Install

npm i x-con

Weekly Downloads

4

Version

4.0.1

License

ISC

Unpacked Size

8.4 kB

Total Files

7

Last publish

Collaborators

  • ameola01