@cxm/logsync

1.1.2 • Public • Published

LogSync

  • Backend remote string console tool by socket.
  • It's easy to use.
  • Simple, Light tool.

NPM version License npm node

Installation

npm i @cxm/logsync

Usage

For the client

  • Initial LogSync and put log code in any line.

    //init client
    const LogSync = require('@cxm/logsync');
    
    const logSync = new LogSync({
      host:'localhost',
      port:8080
    });
    
    //send debug string to the server console
    logSync.log( Math.random() );
    

For the simple server

  • Install socket.io first.

     npm i socket.io --save
    
  • Config server

      const server = require('http').createServer();
    
      const io = require('socket.io')(server);
    
      io.on('connection', client => {
        client.on('log', data => console.log( data ) );
      });
    
      server.listen(8080);
    

Readme

Keywords

none

Package Sidebar

Install

npm i @cxm/logsync

Weekly Downloads

1

Version

1.1.2

License

ISC

Unpacked Size

2.12 kB

Total Files

4

Last publish

Collaborators

  • cxm