{"_id":"write-only-stream","_rev":"211493","name":"write-only-stream","description":"wrap a readable/writable stream to be write-only","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"substack","email":""}],"time":{"modified":"2021-06-03T15:30:03.000Z","created":"2014-09-14T21:58:14.203Z","1.1.0":"2014-09-22T19:00:15.511Z","1.0.0":"2014-09-14T21:58:14.203Z"},"users":{"rcramu":true},"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"repository":{"type":"git","url":"git://github.com/substack/write-only-stream.git"},"versions":{"1.1.0":{"name":"write-only-stream","version":"1.1.0","description":"wrap a readable/writable stream to be write-only","main":"index.js","dependencies":{"readable-stream":"^1.1.13"},"devDependencies":{"tape":"^2.13.2","concat-stream":"^1.4.6","through":"^2.3.4","through2":"^1.1.1"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/write-only-stream.git"},"homepage":"https://github.com/substack/write-only-stream","keywords":["stream","writeonly"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","gitHead":"9d944417007cda6f36127bf2f6a91a4f25f54951","bugs":{"url":"https://github.com/substack/write-only-stream/issues"},"_id":"write-only-stream@1.1.0","_shasum":"88ec503205c3216c9226f56f456fcf9df693bde1","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":""}],"dist":{"shasum":"88ec503205c3216c9226f56f456fcf9df693bde1","size":2466,"noattachment":false,"key":"/write-only-stream/-/write-only-stream-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-only-stream/download/write-only-stream-1.1.0.tgz"},"directories":{},"publish_time":1411412415511,"_cnpm_publish_time":1411412415511,"_hasShrinkwrap":false},"1.0.0":{"name":"write-only-stream","version":"1.0.0","description":"wrap a readable/writable stream to be write-only","main":"index.js","dependencies":{"readable-stream":"^1.1.13"},"devDependencies":{"tape":"^2.13.2","concat-stream":"^1.4.6","through":"^2.3.4","through2":"^1.1.1"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/substack/write-only-stream.git"},"homepage":"https://github.com/substack/write-only-stream","keywords":["stream","writeonly"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","gitHead":"b0608b0e8e12dd9f80c38cf98c8bec93fd73bc9b","bugs":{"url":"https://github.com/substack/write-only-stream/issues"},"_id":"write-only-stream@1.0.0","_shasum":"7a0f16102a96b3c851cbdeec489aa8549b1bb8af","_from":".","_npmVersion":"1.4.25","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"substack","email":""}],"dist":{"shasum":"7a0f16102a96b3c851cbdeec489aa8549b1bb8af","size":2366,"noattachment":false,"key":"/write-only-stream/-/write-only-stream-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/write-only-stream/download/write-only-stream-1.0.0.tgz"},"directories":{},"publish_time":1410731894203,"_cnpm_publish_time":1410731894203,"_hasShrinkwrap":false}},"readme":"# write-only-stream\n\nwrap a readable/writable stream to be write-only\nto prevent mucking up or disclosing output\n\n[![build status](https://secure.travis-ci.org/substack/write-only-stream.png)](http://travis-ci.org/substack/write-only-stream)\n\n# example\n\n\nSuppose you have a module that uses a readable/writable stream internally but\nwant to expose just the writable part of that internal stream. This is common if\nyou use the readable side internally and expose the writable side as the\ninterface.\n\nNow we can write some code like this contrived example with a `through` stream\ninternally for convenience:\n\n``` js\nvar through = require('through2');\nvar concat = require('concat-stream');\nvar writeonly = require('../');\n\nmodule.exports = function (cb) {\n    var stream = through(function (buf, enc, next) {\n        this.push(buf.toString('utf8').toUpperCase());\n        next();\n    });\n    stream.pipe(concat(cb));\n    return writeonly(stream);\n};\n```\n\nbut consumers won't be able to read from the output side:\n\n\n``` js\nvar uc = require('./uc.js');\nprocess.stdin.pipe(uc(function (body) {\n    console.log(body.toString('utf8'));\n})); // can't .pipe() the uc stream anywhere\n```\n\n# methods\n\n``` js\nvar writeonly = require('write-only-stream')\n```\n\n## var wo = writeonly(stream)\n\nReturn a writable stream `wo` that wraps the readable/writable `stream` argument\ngiven to only expose the writable side.\n\n`stream` can be a streams1 or streams2 stream.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install write-only-stream\n```\n\n# license\n\nMIT\n","_attachments":{},"homepage":"https://github.com/substack/write-only-stream","bugs":{"url":"https://github.com/substack/write-only-stream/issues"},"license":"MIT"}