{"id":20181823,"url":"https://github.com/nichoth/pull-mux","last_synced_at":"2025-06-28T10:36:59.073Z","repository":{"id":71795891,"uuid":"78455268","full_name":"nichoth/pull-mux","owner":"nichoth","description":"Combine and namepsace multiple streams","archived":false,"fork":false,"pushed_at":"2017-01-16T01:55:39.000Z","size":17,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-09T07:32:46.478Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/nichoth/pull-mux#readme","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nichoth.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-01-09T18:11:31.000Z","updated_at":"2018-03-12T16:23:46.000Z","dependencies_parsed_at":"2023-06-10T16:00:19.275Z","dependency_job_id":null,"html_url":"https://github.com/nichoth/pull-mux","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/nichoth/pull-mux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichoth%2Fpull-mux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichoth%2Fpull-mux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichoth%2Fpull-mux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichoth%2Fpull-mux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nichoth","download_url":"https://codeload.github.com/nichoth/pull-mux/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nichoth%2Fpull-mux/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262418126,"owners_count":23307991,"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-14T02:36:50.160Z","updated_at":"2025-06-28T10:36:59.047Z","avatar_url":"https://github.com/nichoth.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pull mux\n\nCombine and namepsace multiple streams.\n\n## install\n\n    $ npm install pull-mux\n\n## example\n\n```js\nvar test = require('tape')\nvar S = require('pull-stream')\nvar mux = require('../')\n\ntest('create a namespaced stream from an object', function (t) {\n    t.plan(2)\n    var streams = {\n        a: S.values([1,2,3]),\n        b: S.values([4,5,6])\n    }\n    var stream = mux(streams)\n\n    S(\n        stream,\n        S.collect(function (err, res) {\n            t.error(err)\n            t.deepEqual(res, [\n                ['a', 1],\n                ['b', 4],\n                ['a', 2],\n                ['b', 5],\n                ['a', 3],\n                ['b', 6]\n            ], 'should namespace the events')\n        })\n    )\n})\n\n\ntest('pass in a mux function', function (t) {\n    t.plan(2)\n    var streams = {\n        a: S.values([1,2]),\n        b: S.values([3,4])\n    }\n    var stream = mux(streams, function muxer (type, ev) {\n        return { type: type, data: ev }\n    })\n\n    S(\n        stream,\n        S.collect(function (err, res) {\n            t.error(err)\n            t.deepEqual(res, [\n                { type: 'a', data: 1 },\n                { type: 'b', data: 3 },\n                { type: 'a', data: 2 },\n                { type: 'b', data: 4 },\n            ], 'should map the events')\n        })\n    )\n})\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnichoth%2Fpull-mux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnichoth%2Fpull-mux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnichoth%2Fpull-mux/lists"}