{"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.5","repository":{"type":"git","url":"git+ssh://git@github.com/mazira/base64-stream.git"},"scripts":{"test":"mocha --reporter spec"},"dependencies":{"readable-stream":"^2.0.2"},"devDependencies":{"mocha":"*","should":"*"},"license":"MIT","engine":"node >= 0.8.0","gitHead":"1e6cf9989e9b2dc653d99eb42e027db988f6a82b","bugs":{"url":"https://github.com/mazira/base64-stream/issues"},"homepage":"https://github.com/mazira/base64-stream#readme","_id":"base64-stream@0.1.5","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"rossj","email":"ross@mazira.com"},"dist":{"integrity":"sha512-j3OFbLDb8Wy0SM7HrP1zj8ADVHqaKoL8VNrDnd7wedkoz5onf9le2DgOsCdmg8QQPnUPXd7LLCjGnYAk/YDBFg==","shasum":"f712ae6456ee8dfaf8b444da91d96d88cc394c2f","tarball":"http://registry-npm.ywwl.com/base64-stream/download/base64-stream-0.1.5.tgz","fileCount":5,"unpackedSize":6496,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbw1HcCRA9TVsSAnZWagAAESoQAIWHx5570fpKj7WXNR4e\nGOmgo2i5rQ6sZcIl72mk1AjgTBZOZpyo2HdlGEqIIP56NlnSOrwz7Nz0TLsw\n1NYmpJFnvvSuLg8JAgraKhAg81DwuyYwtfDwIcZTNcoYSg4z8iD496mPEFsV\nkyQVoY/g/K5a8uvkQn6QnuYCPywxFsQ0iNkJBm8ULi8ZLSOD40289wyw9PY3\nvuOEAY6NJx9Za6Rec9svga9q9S+ii0FRNJZToqR2S4E9qkgiZaDnD8zRvZXp\n/dY+Ei1RpXJ45zLC0CNVvZP5aLVd38OyKSWXGT0TLD3qDbgzqx/xRIxu5YID\nJ/vEx5kgyjQAGNlBhQC5fd57cM936en+udu95p2PWtWaNxQPyt7vz5JQO+K2\nUKMBLzwxgfDbPVhZ712vsxU3dTkcXCq9Wh7CiDIaVZpfivMzXep5ozLDxQlm\nckzYtRnZP7lZpTQvuRVFR9qaX/1k3p+jX1im2YbowHwEJQAfykwQj+hBhlVY\nWFtWxF7p+SH/KlhVd05k6jHMdYfslg+bBFrf85eVKMV/hRIQx8uupJLIbX/7\nsyYd/ofz9WH92AVASbwlXMg4pwep8ntu3YcoSPi8eU8g6pgH9+RSDwV+6kDu\nAUh6M3ee0eXHxNGjzGN7jNHzTtdujZKJnmnJj3aQUCD3Vt7eS4veb08j9nvH\nY+Xe\r\n=bEtq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjIQQB5YNNIHBXGHGTDispSCxXvg2P8Tsjm4O1q8kbUgIhAP+2xOg9Olv7ZR4Nc7gBjPBfFwglOrk85Blr90NAXnJd"}],"size":2515,"noattachment":false,"key":"/base64-stream/-/base64-stream-0.1.5.tgz"},"maintainers":[{"name":"rossj","email":"ross@mazira.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/base64-stream_0.1.5_1539527131855_0.11751280330912306"},"_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":1539527131941,"_cnpm_publish_time":1539527131941,"dist-tags":{"latest":"1.0.0"}}