fwsp-umf-message

0.4.3 • Public • Published

UMF Message Build Status

Used to create and validate UMF style messages.

Install

You can install it via NPM:

$ npm -i fwsp-umf-message

Usage

const UMFMessage = require('fwsp-umf-message');
let msg = UMFMessage.createMessage({
  to: `test-service:[GET]/v1/somedata`,
  from: 'client:/',
  body: {
    somevalues: [1,2,3,4]
  }
});

You can also access message fields for getting and setting:

console.log('msg.to', msg.to);
msg.to = 'router:/';
console.log('msg.to', msg.to);

To retrieve an entire message object use:

console.log(msg.toJSON());

Tests

Tests can be found in the specs folder.

$ npm test

Readme

Keywords

none

Package Sidebar

Install

npm i fwsp-umf-message

Weekly Downloads

251

Version

0.4.3

License

MIT

Last publish

Collaborators

  • emadum
  • cjus