custom.stdout
v1.0.2
Published
Allows split output in node stdout to areas. Helps to show "static" information in life-logs, like state of server/service and so on
Downloads
315
Maintainers
Readme
Allows the developer to shows logs in a fixed area of output. It could be useful:
- to show state
- to show errors
- to show important messages
Usage
npm install custom.stdout --save
import { StdoutController } from 'custom.stdout';
// Create instance. As argument we should provide target stream.
// As usual it's process.stdout
const stdout = new StdoutController(process.stdout);
// To post logs into "normal" (common area):
stdout.out('LOGS INTO COMMON AREA');
// To post logs into "fixed" area just define ID of it
stdout.out('Important message', 'messages');
stdout.out('Operations done: 43\nRAM used: 324Mb', 'operations');