1.0.1 • Published 3 years ago

node-betterconsole v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

BetterConsole

An improved console, you can read all the logs, errors, warns with this basic framework.

Uses

Simple ussage.

// ADD THE REQUIRE IN THE FIRST LINE
require('betterconsole');

// LOG WITH EVENT
console.log('hello world');

// LOG WITHOUT EVENT
console.send('hello world');

// WARN 
console.warn('Hello world');

// ERROR
console.error('Hello world');
console.log(new Error('Hello world'));

Events

// LISTEN ALL EVENTS
console.on('all', (data) => {
	console.send(data);
})

// LISTEN LOGS
console.on('log', (data) => {
	console.send(data);
})

// LISTEN WARNINGS
console.on('warn', (data) => {
	console.send(data);
})

// LISTEN ERRORS
console.on('error', (data) => {
	console.send(data);
})

you can also emit events

console.emit('event', {data: "hello world"});

Writed by keigocode