1.2.3 • Published 5 years ago
bitnacle-io v1.2.3
bitnacle-io
bitnacle-io is a dead simple middleware logger to use with socket.io.
Installation
npm i bitnacle-ioQuick start
const io = require('socket.io')();
const bitnacleIo = require('bitnacle-io');
io.on('connection', socket => {
socket.use(bitnacleIo()); // use default "simple" format
...
});
io.listen(3000);If you want to skip some events, you can do it by passing an array of event names to bitnacle-io and they won't be logged:
socket.use(bitnacleIo({
exclude: [
'event_name',
'another_event_name',
'yet_another_event_name'
]
}));Formats
bitnacle-io uses 2 formats, simple (default) and json.
socket.use(bitnacleIo({
format: 'json' // optional: default is "simple"
}));simple format output:
[2019-08-25T20:01:11:130+0200] ["some_event",{"someKey":"someValue"}]json format output:
{"time":"2019-08-25T20:02:43:125+0200","eventData":["some_event",{"someKey":"someValue"}]}1.2.3
5 years ago
1.2.2
6 years ago
1.2.1
6 years ago
1.2.0
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.1-alpha
6 years ago
1.0.0-alpha
6 years ago