{"id":15995953,"url":"https://github.com/fbiville/stream-map","last_synced_at":"2025-07-07T08:36:32.381Z","repository":{"id":144735268,"uuid":"241672242","full_name":"fbiville/stream-map","owner":"fbiville","description":"Issue with failing map (possibly async) functions and streams","archived":false,"fork":false,"pushed_at":"2020-02-19T18:04:27.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-05T00:41:29.699Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fbiville.png","metadata":{"files":{"readme":"README.md","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":"2020-02-19T16:54:34.000Z","updated_at":"2020-02-19T18:04:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"7be1dc9a-5e04-4160-95f8-b9c89ed274a8","html_url":"https://github.com/fbiville/stream-map","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fbiville/stream-map","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbiville%2Fstream-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbiville%2Fstream-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbiville%2Fstream-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbiville%2Fstream-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fbiville","download_url":"https://codeload.github.com/fbiville/stream-map/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fbiville%2Fstream-map/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261519072,"owners_count":23171228,"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-10-08T07:22:07.795Z","updated_at":"2025-06-23T17:10:00.894Z","avatar_url":"https://github.com/fbiville.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Transform stream and promises\n\n`MapTransform` defines a simple [`map`-like operator](https://rxjs-dev.firebaseapp.com/api/operators/map) to work with Node streams.\nIn order to support both synchronous and asynchronous functions, `MapTransform` \n\"promisifies\" the user-defined map function.\n\nIt works very well until an error occurs.\nTry for instance:\n```shell script\n➜ node example.js\nSend an integer, Ctrl-C to stop\n0\n(node:4352) UnhandledPromiseRejectionWarning: Error: division by zero\n    at MapTransform._function (/Users/fbiville/workspace/stream-map/example.js:11:32)\n    at /Users/fbiville/workspace/stream-map/map-transform.js:12:33\n    at processTicksAndRejections (internal/process/task_queues.js:94:5)\n(node:4352) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)\n(node:4352) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.\n... process hangs ...\n```\n\nThe promise gets rejected because `callback` throws when given an error.\nAn obvious is to catch that error and ignore it, but that does not seem like a good idea.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbiville%2Fstream-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffbiville%2Fstream-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffbiville%2Fstream-map/lists"}