pnpm
Version:
Fast, disk space efficient package manager
108 lines (107 loc) • 6.51 kB
JSON
{
"_args": [
[
{
"raw": "duplexify@^3.5.0",
"scope": null,
"escapedName": "duplexify",
"name": "duplexify",
"rawSpec": "^3.5.0",
"spec": ">=3.5.0 <4.0.0",
"type": "range"
},
"/home/zoltan/src/pnpm/pnpm/packages/pnpm/node_modules/peek-stream"
]
],
"_from": "duplexify@^3.5.0",
"_hasShrinkwrap": false,
"_id": "duplexify@3.7.1",
"_location": "/duplexify",
"_nodeVersion": "10.15.1",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/duplexify_3.7.1_1549298243866_0.6164307625554561"
},
"_npmUser": {
"name": "mafintosh",
"email": "mathiasbuus@gmail.com"
},
"_npmVersion": "6.4.1",
"_phantomChildren": {},
"_requested": {
"raw": "duplexify@^3.5.0",
"scope": null,
"escapedName": "duplexify",
"name": "duplexify",
"rawSpec": "^3.5.0",
"spec": ">=3.5.0 <4.0.0",
"type": "range"
},
"_requiredBy": [
"/peek-stream",
"/pumpify"
],
"_resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz",
"_shasum": "2a4df5317f6ccfd91f86d6fd25d8d8a103b88309",
"_shrinkwrap": null,
"_spec": "duplexify@^3.5.0",
"_where": "/home/zoltan/src/pnpm/pnpm/packages/pnpm/node_modules/peek-stream",
"author": {
"name": "Mathias Buus"
},
"bugs": {
"url": "https://github.com/mafintosh/duplexify/issues"
},
"dependencies": {
"end-of-stream": "^1.0.0",
"inherits": "^2.0.1",
"readable-stream": "^2.0.0",
"stream-shift": "^1.0.0"
},
"description": "Turn a writable and readable stream into a streams2 duplex stream with support for async initialization and streams1/streams2 input",
"devDependencies": {
"concat-stream": "^1.5.2",
"tape": "^4.0.0",
"through2": "^2.0.0"
},
"directories": {},
"dist": {
"integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==",
"shasum": "2a4df5317f6ccfd91f86d6fd25d8d8a103b88309",
"tarball": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz",
"fileCount": 7,
"unpackedSize": 17129,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcWGpECRA9TVsSAnZWagAAwegP+wVmE/yTLEAQqBFl7Lg0\nFzP/KE3nlxPZEOBFREnM6TOH+R6qhiJ0FfrtGSy4/gjgUs/FgSPcbWrmDf91\nWQ6ZmjfW8s5Ms8rQ2kPzLd2g8zFNdyxjRadEhL0ecRrhBjwfmONXeXEUKz8l\nM5EauN9tdldv4V5f8g1sHhvDDz6mmfErtKv43J2LgFoRqlpl4esY9EdIF3Ei\nIAoU2NFCmUGKBEpzqrsOwMJ6Vyw9QdWO7BJIny79/x/86lCBWZR0br1hAs3W\nx+mQHZrZ80pd3RFDdZzrJQqb90keg10RMByB6rexQ1ZHFW14MYfsyGLblQo5\nJjcJRlWB5ldHq26Zc5zuW79X9b/t7LU52/3UZN4EDCkWSK5/nK6UTN49W6bm\n6Z+z6ewHUKAT/ar5W+8Lh3ZSDj6Dh8ElpwUEsORUQxuAbKlERuHlCX7KmRkG\ntyBrreHOYm1R3gRK1ye03TfTYOXFZhoBCLSZCbsAqEiqlHr7GR+bR0O9eYDz\nAzgUAAwoaEegMht9y3EaGtByWKl91Pb4ejW0ZiefzrADCVHzFa0/eXlny8p6\nEsGOiiIWQqnXJiVPKzsi6teYcH9Cxf8VZfeBgc2NuHkMOrW41LR0J/95G+wk\nJlvxrB9tbM7B69F6g1uoCJ9zXG9l9gVnXgJxVn4YUYRVOwIVtIVJz8e5cpqK\nUWnJ\r\n=n3Aw\r\n-----END PGP SIGNATURE-----\r\n"
},
"gitHead": "f6af4f971bf4c99750f44751b99942675f0ab5df",
"homepage": "https://github.com/mafintosh/duplexify",
"keywords": [
"duplex",
"streams2",
"streams",
"stream",
"writable",
"readable",
"async"
],
"license": "MIT",
"main": "index.js",
"maintainers": [
{
"name": "mafintosh",
"email": "mathiasbuus@gmail.com"
}
],
"name": "duplexify",
"optionalDependencies": {},
"readme": "# duplexify\n\nTurn a writeable and readable stream into a single streams2 duplex stream.\n\nSimilar to [duplexer2](https://github.com/deoxxa/duplexer2) except it supports both streams2 and streams1 as input\nand it allows you to set the readable and writable part asynchronously using `setReadable(stream)` and `setWritable(stream)`\n\n```\nnpm install duplexify\n```\n\n[](http://travis-ci.org/mafintosh/duplexify)\n\n## Usage\n\nUse `duplexify(writable, readable, streamOptions)` (or `duplexify.obj(writable, readable)` to create an object stream)\n\n``` js\nvar duplexify = require('duplexify')\n\n// turn writableStream and readableStream into a single duplex stream\nvar dup = duplexify(writableStream, readableStream)\n\ndup.write('hello world') // will write to writableStream\ndup.on('data', function(data) {\n // will read from readableStream\n})\n```\n\nYou can also set the readable and writable parts asynchronously\n\n``` js\nvar dup = duplexify()\n\ndup.write('hello world') // write will buffer until the writable\n // part has been set\n\n// wait a bit ...\ndup.setReadable(readableStream)\n\n// maybe wait some more?\ndup.setWritable(writableStream)\n```\n\nIf you call `setReadable` or `setWritable` multiple times it will unregister the previous readable/writable stream.\nTo disable the readable or writable part call `setReadable` or `setWritable` with `null`.\n\nIf the readable or writable streams emits an error or close it will destroy both streams and bubble up the event.\nYou can also explicitly destroy the streams by calling `dup.destroy()`. The `destroy` method optionally takes an\nerror object as argument, in which case the error is emitted as part of the `error` event.\n\n``` js\ndup.on('error', function(err) {\n console.log('readable or writable emitted an error - close will follow')\n})\n\ndup.on('close', function() {\n console.log('the duplex stream is destroyed')\n})\n\ndup.destroy() // calls destroy on the readable and writable part (if present)\n```\n\n## HTTP request example\n\nTurn a node core http request into a duplex stream is as easy as\n\n``` js\nvar duplexify = require('duplexify')\nvar http = require('http')\n\nvar request = function(opts) {\n var req = http.request(opts)\n var dup = duplexify(req)\n req.on('response', function(res) {\n dup.setReadable(res)\n })\n return dup\n}\n\nvar req = request({\n method: 'GET',\n host: 'www.google.com',\n port: 80\n})\n\nreq.end()\nreq.pipe(process.stdout)\n```\n\n## License\n\nMIT\n\n## Related\n\n`duplexify` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one.\n",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git://github.com/mafintosh/duplexify.git"
},
"scripts": {
"test": "tape test.js"
},
"version": "3.7.1"
}