console-extra

1.0.8 • Public • Published

Console-Extra

A module that allows logging to multiple streams simultaneously.

Setup

const Console = require('console-extra').ConsoleAsync;

delete console;

console = await Console(process.stdout, process.stderr); //bound to out and err respectively
//or
console = await Console(process.stdout, process.stderr, 'stream3.log'); //all bound to both err and out!
//or
console = await Console([ process.stdout, process.stderr, 'stream3.log', ... ]); //all bound to both err and out
//or
console = await Console({
	output: process.stdout,
	error: process.stderr
}); //bound to out and err respectively
//or
console = await Console({
	output: [ process.stdout, process.stderr ],
	error: 'file.txt'
}); //bound to out and err respectively - BEST

This module extends the builtin Console
Use the non-async version only for already-opened and writable streams!

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i console-extra

    Weekly Downloads

    1

    Version

    1.0.8

    License

    ISC

    Unpacked Size

    14.7 kB

    Total Files

    4

    Last publish

    Collaborators

    • valentin_h