0.4.3 • Published 9 years ago
fwsp-umf-message v0.4.3
UMF Message 
Used to create and validate UMF style messages.
Install
You can install it via NPM:
$ npm -i fwsp-umf-messageUsage
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