1.0.5 • Published 4 years ago
@fcannizzaro/console-log-ws v1.0.5
@fcannizzaro/console-log-ws
A Websocket server / client to use a remote console.log
Installation
npm i --save @fcannizzaro/console-log-ws
Usage
- Start a log server (
defaults
port=2222, address=0.0.0.0)npx @fcannizzaro/console-log-ws [PORT] [ADDRESS]
Connect the client and logs from the client process
const logs = require('@fcannizzaro/console-log-ws'); logs.setup().then(() => { console.log("log1"); console.log("log2"); console.log("log3"); // if nothing else you can close the process by closing the ws console.off(); });
Methods
setup(,
port: number, address: string
)Connect the client to the log server. Port and address are optional args.
const logs = require('console-log-ws'); logs.setup(4444, '192.168.1.32')
console.off()
Close the ws connection in the client. (ex. a node process with a connected websocket will never close 😆)
Author
Francesco Saverio Cannizzaro (fcannizzaro)
License
MIT License