1.0.5 • Published 4 years ago

@fcannizzaro/console-log-ws v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@fcannizzaro/console-log-ws

A Websocket server / client to use a remote console.log

NPM

Installation

npm i --save  @fcannizzaro/console-log-ws

Usage

  1. Start a log server (defaults port=2222, address=0.0.0.0)
    npx @fcannizzaro/console-log-ws [PORT] [ADDRESS]
  2. 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

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago