npm.io
1.0.1 • Published 8 years ago

@p4d/socket-logs

Licence
WTFPL
Version
1.0.1
Deps
0
Vulns
0
Weekly
0

Socket Logs

Description

Small NPM package that receives a socket io connection instance and prints on the console generic data about the connection, errors, and disconnects

Installation

npm install --save @p4d/socket-logs

Usage

Require package
	const socketLogs = require('@p4d/socket-logs')
Create hermes object

var io = socketio.listen(config.socket.port)
io.on('connection', (socket) => {
	socketLogs.start(socket)
})

Future updates

Logs are currently printed on the console, may be worth exploring logging to a specific file or somewhere else

Keywords