fwsp-umf-message
v0.4.3
Published
umf-message: a tool for creating and working with UMF style messages
Downloads
443
Readme
UMF Message
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