{"id":20088110,"url":"https://github.com/jacobbubu/pull-pair","last_synced_at":"2025-03-02T14:42:42.144Z","repository":{"id":38175247,"uuid":"250754716","full_name":"jacobbubu/pull-pair","owner":"jacobbubu","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-10T01:18:04.000Z","size":1181,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-13T02:30:02.095Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/jacobbubu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","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":"2020-03-28T09:17:27.000Z","updated_at":"2020-04-24T16:04:46.000Z","dependencies_parsed_at":"2024-11-13T21:02:58.001Z","dependency_job_id":null,"html_url":"https://github.com/jacobbubu/pull-pair","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"73aff19256c57cc789452fdb0ba9ae328c3d8bb0"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobbubu%2Fpull-pair","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobbubu%2Fpull-pair/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobbubu%2Fpull-pair/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobbubu%2Fpull-pair/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacobbubu","download_url":"https://codeload.github.com/jacobbubu/pull-pair/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241523941,"owners_count":19976424,"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":[],"created_at":"2024-11-13T16:11:51.503Z","updated_at":"2025-03-02T14:42:42.123Z","avatar_url":"https://github.com/jacobbubu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @jacobbubu/pull-pair\n\n[![Build Status](https://travis-ci.org/jacobbubu/pull-pair.svg)](https://travis-ci.org/jacobbubu/pull-pair)\n[![Coverage Status](https://coveralls.io/repos/github/jacobbubu/pull-pair/badge.svg)](https://coveralls.io/github/jacobbubu/pull-pair)\n[![npm](https://img.shields.io/npm/v/@jacobbubu/pull-pair.svg)](https://www.npmjs.com/package/@jacobbubu/pull-pair/)\n\n\u003e Rewritten [pull-pair](https://github.com/dominictarr/pull-pair) in TypeScript.\n\n# pull-pair\n\nA pair of {source, sink} streams that are internally connected,\n(what goes into the sink comes out the source)\n\nThis can be used to construct pipelines that are connected.\n\n``` js\nimport * as pull from 'pull-stream'\nimport { pair } from '@jacobbubu/pull-pair'\n\nconst pa = pair()\n\n// Read values into this sink...\npull(pull.values([1, 2, 3]), pa.sink)\n\n// But that should become the source over here.\npull(pa.source, pull.collect(function (err, values) {\n  if(err) throw err\n  console.log(values) //[1, 2, 3]\n}))\n\n```\n\nThis is particularly useful for creating duplex streams especially\naround servers. Use `pull-pair/duplex` to get two duplex streams\nthat are attached to each other.\n\n``` js\nimport { duplex } from '@jacobbubu/pull-pair'\n\nconst dup = duplex()\n\n// The \"client\": pipe to the first duplex and get the response.\npull(\n  pull.values([1,2,3]),\n  dup[0],\n  pull.collect(console.log) // =\u003e 10, 20, 30\n)\n\n// The \"server\": pipe from the second stream back to itself\n// (in this case) applying a transformation.\npull(\n  dup[1],\n  pull.map(function (e) {\n    return e*10\n  }),\n  dup[1]\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobbubu%2Fpull-pair","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacobbubu%2Fpull-pair","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobbubu%2Fpull-pair/lists"}