var StdMsg = require('stdmsg').default;
let stdMsg = new StdMsg('me', 'you', inputStream, outputStream);
stdMsg.listen([option,] callback)
- option
- contentType 'string'|'jsonStr'|... Default: jsonStr
- callback
- err |
- data
- header
- content ||...
exp.
stdMsg.listen({contentType: 'string'}, (err, data) => {
console.log(data);
});
stdMsg.send(payload[, option])
- payload ||...
- option contentType 'string'|'jsonStr'|... Default: jsonStr
exp.
stdMsg.send({a: 1}, {contentType: 'string'});