swan-stdmsg

1.0.7 • Public • Published
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'});

Readme

Keywords

none

Package Sidebar

Install

npm i swan-stdmsg

Weekly Downloads

7

Version

1.0.7

License

ISC

Unpacked Size

21.3 kB

Total Files

16

Last publish

Collaborators

  • liyang_npm