UNPKG

auto-daemon

Version:

automatically spawn implicit background services

10 lines (8 loc) 227 B
var n = 0; module.exports = function (server, stream) { return { add: function (m, cb) { cb(n += m) }, get: function (cb) { cb(n) }, close: function () { server.close(); stream.destroy() } } };