1.1.2 • Published 6 years ago
@cxm/logsync v1.1.2
LogSync
- Backend remote string console tool by socket.
- It's easy to use.
Simple, Light tool.
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);