{"name":"base64-stream","description":"Contains new Node.js v0.10 style stream classes for encoding / decoding Base64 data","keywords":["Base64","stream","streaming","piping","node","node.js","encode","decode"],"author":{"name":"Ross Johnson","email":"ross@mazira.com"},"version":"0.1.4","repository":{"type":"git","url":"git+ssh://git@github.com/mazira/base64-stream.git"},"scripts":{"test":"mocha --reporter spec"},"dependencies":{},"devDependencies":{"mocha":"*","should":"*"},"license":"MIT","engine":"node >= 0.8.0","gitHead":"54073e0ab3b5c211a9f9ecec1b91792153a7ffb2","bugs":{"url":"https://github.com/mazira/base64-stream/issues"},"homepage":"https://github.com/mazira/base64-stream#readme","_id":"base64-stream@0.1.4","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"rossj","email":"ross@mazira.com"},"dist":{"integrity":"sha512-hESgjrXnLEh+7BCxIXi3ZGFHJ/wYAfew31flte6aM8ZeANOos25FJUt0Ki4V8eAn/+T+CM6ClNjesdqXVkVO8Q==","shasum":"4a6324474b56af964234399249b20815ab322963","tarball":"http://registry-npm.ywwl.com/base64-stream/download/base64-stream-0.1.4.tgz","fileCount":5,"unpackedSize":7758,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbwNerCRA9TVsSAnZWagAAaBIP/A7l+Crta+LeUlXHLEwF\nP9QBSgYErc1BApLVYrEIBxjLSu5qaG6L3Ai4zY/XgV8xK/9chPbt/d9OHxLx\nVGCmmpoRDmX+HPS4fbWgQj+0pjZNqI6jBaPq4o8TYatQ8/tR2Tr8NZQ9ihB+\nJ/BgnnNEHx0hk8YF/qvNGDGXDsKq8nqb8/uSI/fTG7R4h+K0LgL/z1SSvgWq\n+pgFirun2nv+yw/5SFMooY8GU3FQb5V/waZfbRgcmdlkFU9MaUBFlRQ31FVV\n6LDpCCBYq0JsaDQYUv1zPh98jepoM1KAvqx0qflZpHuZLLAxUE6cO0hyNzF1\nK6j7kQINq7yX5TG1w2B71MaFqOZbCvvMSXsb14nOjDmnHQia7lyAThapedOs\nJc54rd8367Mx3OMMm/t86f64PcqpfP7GyKfSv+TNxz1yphfMxjabOjtamuX5\n5/zzAP8xOGVasYkGnZ6KPosT/WU0MJSEWGl9qOUNvClgGsnAFzUpuvTT25B5\nHIPZ9I1gIcgeybkDbytrlUGOsUdrKoVVyoegF81FV+w/VjGf9LQFIwqNoikV\nYmNPd6fD1gM/8ozH/KH+/t0HItEG7XRKm2sMCRSqOunWn8g+H1RwTJ+Qi5pp\nAHxlQG2yf9a7QrJfr3O9NjoEzAzPW2piVF3MeRVI0OlesKtjkb+lvNRdBGGP\nvz0L\r\n=jtQG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG0WfcxC1Xbx1PMSjjd8+Cm235VizyN6uBXmIrc/xlaCAiEA4PmgocpR05aXreyK7aqhgF2ZpdZWl38kUqzRhZnTbsw="}],"size":2866,"noattachment":false,"key":"/base64-stream/-/base64-stream-0.1.4.tgz"},"maintainers":[{"name":"rossj","email":"ross@mazira.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/base64-stream_0.1.4_1539364778823_0.22021352220385726"},"_hasShrinkwrap":false,"readme":"# Introduction\n\nWhile Node.js has built-in support for Base64 data, it does not come with the ability to encode / decode data in a stream.\n\nThis library contains a streaming Base64 encoder and a streaming Base64 decoder for use with Node.js. These classes are written using the Node.js [stream interfaces](http://nodejs.org/api/stream.html) and are well covered with unit tests.\n\n# Usage\n\n## Installation\n\nTo install base64-stream\n\n    npm install base64-stream\n    \n## Examples\nThis example encodes an image and pipes it to stdout.\n\n```javascript\nvar http = require('http');\nvar {Base64Encode} = require('base64-stream');\n\nvar img = 'http://farm3.staticflickr.com/2433/3973241798_86ddfa642b_o.jpg';\nhttp.get(img, function(res) {\n    if (res.statusCode === 200)\n        res.pipe(new Base64Encode()).pipe(process.stdout);\n});\n```\n\nThis example takes in Base64 encoded data on stdin, decodes it, an pipes it to stdout.\n```javascript\nvar {Base64Encode} = require('base64-stream');\nprocess.stdin.pipe(new Base64Encode()).pipe(process.stdout);\n```\n\n## options:\n\n`Base64Encode` can take an optional object `{lineLength: number, prefix: string}`  \nThe prefix is useful for prepending for example `data:image/png;base64,` to make a base64 URL.  \nThis example proxies an image url, and send the base64 string in response.\n\n```\napp.get('/i/*', function(req, res){ // using express for example\n\tfetch(req.params[0]) // using node-fetch\n\t.then(r=>r.body.pipe(new Base64Encode({prefix:`data:${r.headers.get('content-type')};base64,`})).pipe(res))\n\t.catch(console.error);\n});\n```\n\n# Requirements\n\nThis module currently requires Node 6.0.0 or higher.\n\n# Testing\n\nTo run the unit tests\n\n    npm test\n\n# License\nMIT\n","publish_time":1539364778930,"_cnpm_publish_time":1539364778930,"dist-tags":{"latest":"1.0.0"}}