Higher level Message object for the AMP protocol
npm install amp-message High level AMP Message implementation for manipulating, encoding and decoding AMP messages.
```
$ npm install amp-message
Encoding a message:
`js
var Message = require('amp-message');
var msg = new Message;
console.log(msg.toBuffer());
// =>
msg.push('foo');
msg.push('bar');
msg.push('baz');
console.log(msg.toBuffer());
// =>
msg.push({ foo: 'bar' });
console.log(msg.toBuffer());
// =>
msg.push(new Buffer('image data'));
console.log(msg.toBuffer());
// =>
`
Decoding a message:
`js
var Message = require('..');
var msg = new Message;
msg.push('foo')
msg.push({ hello: 'world' })
msg.push(new Buffer('hello'))
var other = new Message(msg.toBuffer());
console.log(other.shift());
console.log(other.shift());
console.log(other.shift());
`
Initialize an empty message.
Decode the buffer AMP message to populate the Message.
Initialize a messeage populated with args`.
MIT