{"id":18458768,"url":"https://github.com/browserify/labeled-stream-splicer","last_synced_at":"2025-05-16T04:06:44.220Z","repository":{"id":55559498,"uuid":"20713440","full_name":"browserify/labeled-stream-splicer","owner":"browserify","description":"stream splicer with labels","archived":false,"fork":false,"pushed_at":"2024-12-21T10:15:17.000Z","size":16,"stargazers_count":43,"open_issues_count":2,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T13:06:05.300Z","etag":null,"topics":["nodejs","pipeline","stream","streams"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/browserify.png","metadata":{"files":{"readme":"readme.markdown","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-06-11T05:29:01.000Z","updated_at":"2024-10-18T03:02:41.000Z","dependencies_parsed_at":"2024-06-18T13:51:20.224Z","dependency_job_id":"371ed281-d356-4dc9-bab7-b81c96bcbabc","html_url":"https://github.com/browserify/labeled-stream-splicer","commit_stats":{"total_commits":20,"total_committers":4,"mean_commits":5.0,"dds":0.55,"last_synced_commit":"31dbd99c6dabb11e1bd7f4fa8194c5dd0d877296"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Flabeled-stream-splicer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Flabeled-stream-splicer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Flabeled-stream-splicer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/browserify%2Flabeled-stream-splicer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/browserify","download_url":"https://codeload.github.com/browserify/labeled-stream-splicer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247856544,"owners_count":21007621,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nodejs","pipeline","stream","streams"],"created_at":"2024-11-06T08:19:58.235Z","updated_at":"2025-04-08T14:11:51.069Z","avatar_url":"https://github.com/browserify.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# labeled-stream-splicer\n\n[stream splicer](https://npmjs.org/package/stream-splicer) with labels\n\n[![build status](https://secure.travis-ci.org/browserify/labeled-stream-splicer.png?branch=master)](http://travis-ci.org/browserify/labeled-stream-splicer)\n\n# example\n\nHere's an example that exposes a label for `deps` and `pack`:\n\n``` js\nvar splicer = require('labeled-stream-splicer');\nvar through = require('through2');\nvar deps = require('module-deps');\nvar pack = require('browser-pack');\nvar lstream = require('lstream');\n\nvar pipeline = splicer.obj([\n    'deps', [ deps() ],\n    'pack', [ pack({ raw: true }) ]\n]);\n\npipeline.get('deps').unshift(lstream());\n\npipeline.get('deps').push(through.obj(function (row, enc, next) {\n    row.source = row.source.toUpperCase();\n    this.push(row);\n    next();\n}));\n\nprocess.stdin.pipe(pipeline).pipe(process.stdout);\n```\n\nHere the `deps` sub-pipeline is augmented with a post-transformation that\nuppercases its source input.\n\n# methods\n\n``` js\nvar splicer = require('labeled-stream-splicer')\n```\n\nThe API is the same as\n[stream-splicer](https://npmjs.org/package/stream-splicer),\nexcept that `pipeline.get()`, `pipeline.splice()`, and `pipeline.indexOf()` can\naccept string labels in addition to numeric indexes.\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\nTo signify a label, a stream may have a `.label` property or a string may be\nplaced in the `streams` array.\n\nFor example, for streams `[ a, 'foo', b, c, 'bar', d ]`, this pipeline is\nconstructed internally:\n\n```\na.pipe(b).pipe(c).pipe(d)\n```\n\nwith a label `'foo`' that points to `b` and a label `'bar'` that points to `d`.\nIf `a` or `c` has a `.label` property, that label would be used for addressing.\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 labeled pipelines. This is useful if you want to expose a hookable\npipeline with grouped 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`index` can be an integer index or a label.\n\n## pipeline.push(stream, ...)\n\nPush one or more streams to the end of the pipeline.\n\nThe stream arguments may have a `label` property that will be used for string\nlookups.\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\nThe stream arguments may have a `label` property that will be used for string\nlookups.\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`.\n\n`index` can be an integer or a string label.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install labeled-stream-splicer\n```\n\n# license\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserify%2Flabeled-stream-splicer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrowserify%2Flabeled-stream-splicer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrowserify%2Flabeled-stream-splicer/lists"}