swan-stdmsg
v1.0.7
Published
``` var StdMsg = require('stdmsg').default; let stdMsg = new StdMsg('me', 'you', inputStream, outputStream); ``` stdMsg.listen([option,] callback) ---
Downloads
10
Readme
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'});