ascii-armor-stream
v1.0.3
Published
Create ascii armor messages
Downloads
4
Readme
ascii-armor-stream
Create ascii armor messages
example
var armor = require('ascii-armor-stream');
// encode
var encoder = armor.encode('fancy', { food: taco });
encoder.write('ohai');
encoder.end();
/**
* -----BEGIN FANCY MESSAGE-----
* Version: ascii-armor-stream v1.0.0
* Food: taco
*
* b2hhaQo=
* -----END FANCY MESSAGE-----
*/
// decode
var decoder = armor.decode();
myEncodedStream.pipe(decoder);
decoder.on('header', function(key, value) {
// handle headers
});
install
With npm do:
npm install ascii-armor-stream