{"name":"stream-splicer","version":"2.0.1","description":"streaming pipeline with a mutable configuration","main":"index.js","dependencies":{"inherits":"^2.0.1","readable-stream":"^2.0.2"},"devDependencies":{"JSONStream":"^1.0.4","concat-stream":"^1.4.6","split":"^1.0.0","tape":"^4.2.0","through2":"^2.0.0"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/browserify/stream-splicer.git"},"homepage":"https://github.com/browserify/stream-splicer","keywords":["stream","mutable","pipeline"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","gitHead":"d11ce6d702d979d7d701de90ae783640da4cb972","bugs":{"url":"https://github.com/browserify/stream-splicer/issues"},"_id":"stream-splicer@2.0.1","_nodeVersion":"11.15.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg==","shasum":"0b13b7ee2b5ac7e0609a7463d83899589a363fcd","tarball":"http://registry-npm.ywwl.com/stream-splicer/download/stream-splicer-2.0.1.tgz","fileCount":20,"unpackedSize":26116,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc58h4CRA9TVsSAnZWagAAuqsQAKKN2K4T7bVTol+gdtgZ\nk91DGf+RZU1OWjjlRT3Nocaq+ez8VNQ2mjwg4lPUYoRt7MVV7bl/GJneqQ8I\nkxhfYtPUfbA2luyyeH76YW/KM5dlzEVWUOxxjyT2sHsGhUKJ62kLBwrsi9B7\nKBNiyR7zgHX/YM0vRarzpCMMSGrQHIQ83+eQVZXkSVfY9DraGGQvB94dQ/N1\nBkxzYeCGx/aOZfXN96czJF3Js0vt5lZ/bzhVD9UqQtYIH1HKnqEXJYxQQLx+\nxe5CX86fKCx2AQ00DUotgdF/xmnWX7d7TNc6GszRbolNLGGFXgGvHXeWQoB2\nUURlyKp1lVRxDGR04uemdEUCu5xsGq31cuG0Lf3SQUkEAUtG8dJI3r2YaCrD\nDaHDY+3BKSoRvZeFKs3uOY6THdtC2sNiOEXvMmhlpmGw8uEpFmG5ln5iI5IR\n9gl8icOcnpQMwjHjAQUdJD2yb6LXmaPMB/Z2/822iowgfhs2rCcy3W8V0nKb\n44EVPzAXg8uXBCD0UFUV1oddqm03CZLonca//Wm4NHD+QgEPoXpEzDCj5gK8\n2d/R8aZli0WHfIpl0dEYrBeMhGcWiuUia3asjfpH6o3FJr7AYftA9J7dPvlC\nqu16Vpn5oIAWvZHMqYo1SzxS0z44LJ8eoEKPw6BBzCSCesJUhfQc7yPUbcrU\n5NEC\r\n=8CxA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEbTpIE4NyKEF2HWKWeBu4OkyNsbPHLPEMiU22CrOCJNAiB1zYl/y3cM0iR0hZe/sSFe9GtF+Q8CXUSiJ9FUzM2/0Q=="}],"size":6141,"noattachment":false,"key":"/stream-splicer/-/stream-splicer-2.0.1.tgz"},"maintainers":[{"email":"michael.williams@enspiral.com","name":"ahdinosaur"},{"email":"vestibule@anandthakker.net","name":"anandthakker"},{"email":"darawk@gmail.com","name":"ashaffer88"},{"email":"b@lupton.cc","name":"balupton"},{"email":"post.ben.here@gmail.com","name":"bpostlethwaite"},{"email":"bcomnes@gmail.com","name":"bret"},{"email":"calvin.metcalf@gmail.com","name":"cwmma"},{"email":"shtylman@gmail.com","name":"defunctzombie"},{"email":"dominic.tarr@gmail.com","name":"dominictarr"},{"email":"contact@elnounch.net","name":"elnounch"},{"email":"github@tixz.dk","name":"emilbayes"},{"email":"feross@feross.org","name":"feross"},{"email":"forbes@lindesay.co.uk","name":"forbeslindesay"},{"email":"pereira.filype@gmail.com","name":"fpereira1"},{"email":"garann@gmail.com","name":"garann"},{"email":"me@gkatsev.com","name":"gkatsev"},{"email":"renee@kooi.me","name":"goto-bus-stop"},{"email":"hughskennedy@gmail.com","name":"hughsk"},{"email":"fedor@indutny.com","name":"indutny"},{"email":"npm-public@jessemccarthy.net","name":"jmm"},{"email":"jprichardson@gmail.com","name":"jprichardson"},{"email":"jryans@gmail.com","name":"jryans"},{"email":"martin.heidegger@gmail.com","name":"leichtgewicht"},{"email":"lukechilds123@gmail.com","name":"lukechilds"},{"email":"mathiasbuus@gmail.com","name":"mafintosh"},{"email":"dave.des@gmail.com","name":"mattdesl"},{"email":"max@maxogden.com","name":"maxogden"},{"email":"palmermebane@gmail.com","name":"mellowmelon"},{"email":"parshap+npm@gmail.com","name":"parshap"},{"email":"peteris.krumins@gmail.com","name":"pkrumins"},{"email":"sethvincent@gmail.com","name":"sethvincent"},{"email":"maochenyan@gmail.com","name":"stevemao"},{"email":"substack@gmail.com","name":"substack"},{"email":"me@JoshDuff.com","name":"tehshrike"},{"email":"terinjokes@gmail.com","name":"terinjokes"},{"email":"thlorenz@gmx.de","name":"thlorenz"},{"email":"ungoldman@gmail.com","name":"ungoldman"},{"email":"yerko.palma@usach.cl","name":"yerkopalma"},{"email":"yoshuawuyts@gmail.com","name":"yoshuawuyts"},{"email":"zertosh@gmail.com","name":"zertosh"}],"_npmUser":{"name":"goto-bus-stop","email":"renee@kooi.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stream-splicer_2.0.1_1558694007753_0.031990716728030666"},"_hasShrinkwrap":false,"readme":"# stream-splicer\n\nstreaming pipeline with a mutable configuration\n\nThis module is similar to\n[stream-combiner](https://npmjs.org/package/stream-combiner),\nbut with a pipeline configuration that can be changed at runtime.\n\n[![build status](https://travis-ci.org/browserify/stream-splicer.png?branch=master)](http://travis-ci.org/browserify/stream-splicer)\n\n# example\n\nThis example begins with an HTTP header parser that waits for an empty line to\nsignify the end of the header. At that point, it switches to a streaming json\nparser to operate on the HTTP body.\n\n``` js\nvar splicer = require('stream-splicer');\nvar through = require('through2');\nvar jsonStream = require('jsonstream2');\nvar split = require('split2');\n\nvar headerData = {};\nvar headers = through.obj(function (buf, enc, next) {\n    var line = buf.toString('utf8');\n    if (line === '') {\n        this.push(headerData);\n        pipeline.splice(1, 1, jsonStream.parse([ 'rows', true ]));\n    }\n    else {\n        var m = /^(\\S+):(.+)/.exec(line);\n        var key = m && m[1].trim();\n        var value = m && m[2].trim();\n        if (m) headerData[key] = value;\n    }\n    next();\n});\nvar pipeline = splicer([ split(), headers, jsonStream.stringify() ]);\nprocess.stdin.pipe(pipeline).pipe(process.stdout);\n```\n\nintput:\n\n```\nGET / HTTP/1.1\nHost: substack.net\nUser-Agent: echo\n\n{\"rows\":[\"beep\",\"boop\"]}\n```\n\noutput:\n\n```\n$ echo -ne 'GET / HTTP/1.1\\nHost: substack.net\\nUser-Agent: echo\\n\\n{\"rows\":[\"beep\",\"boop\"]}\\n' | node example/header.js\n[\n{\"Host\":\"substack.net\",\"User-Agent\":\"echo\"}\n,\n\"beep\"\n,\n\"boop\"\n]\n```\n\n# methods\n\n``` js\nvar splicer = require('stream-splicer')\n```\n\n## var pipeline = splicer(streams, opts)\n\nCreate a `pipeline` duplex stream given an array of `streams`. Each `stream`\nwill be piped to the next. Writes to `pipeline` get written to the first stream\nand data for reads from `pipeline` come from the last stream.\n\nFor example, for streams `[ a, b, c, d ]`, this pipeline is constructed\ninternally:\n\n```\na.pipe(b).pipe(c).pipe(d)\n```\n\nInput will get written into `a`. Output will be read from `d`.\n\nIf any of the elements in `streams` are arrays, they will be converted into\nnested pipelines. This is useful if you want to expose a hookable pipeline with\ngrouped insertion points.\n\n## var pipeline = splicer.obj(streams, opts)\n\nCreate a `pipeline` with `opts.objectMode` set to true for convenience.\n\n## var removed = pipeline.splice(index, howMany, stream, ...)\n\nSplice the pipeline starting at `index`, removing `howMany` streams and\nreplacing them with each additional `stream` argument provided.\n\nThe streams that were removed from the splice and returned.\n\n## pipeline.push(stream, ...)\n\nPush one or more streams to the end of the pipeline.\n\n## var stream = pipeline.pop()\n\nPop a stream from the end of the pipeline.\n\n## pipeline.unshift(stream, ...)\n\nUnshift one or more streams to the begining of the pipeline.\n\n## var stream = pipeline.shift()\n\nShift a stream from the begining of the pipeline.\n\n## var stream = pipeline.get(index, ...)\n\nReturn the stream at index `index, ...`. Indexes can be negative.\n\nMultiple indexes will traverse into nested pipelines.\n\n# attributes\n\n## pipeline.length\n\nThe number of streams in the pipeline\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install stream-splicer\n```\n\n# license\n\nMIT\n","publish_time":1558694007924,"_cnpm_publish_time":1558694007924,"dist-tags":{"latest":"2.0.1"}}