{"id":25837282,"url":"https://github.com/devtin/stream-flow-async","last_synced_at":"2026-03-02T23:38:41.640Z","repository":{"id":95459816,"uuid":"403691634","full_name":"devtin/stream-flow-async","owner":"devtin","description":"A utility wrapper to asynchronously post-process data from a Readable stream that controls the stream flow to a maximum amount of concurrent un-resolved async operations in order to avoid back-pressuring","archived":false,"fork":false,"pushed_at":"2021-09-06T16:36:41.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"development","last_synced_at":"2025-11-28T12:55:24.232Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","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/devtin.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-09-06T16:33:01.000Z","updated_at":"2021-09-06T16:36:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"e57e9097-6004-4851-80c7-8bb021a57156","html_url":"https://github.com/devtin/stream-flow-async","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devtin/stream-flow-async","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtin%2Fstream-flow-async","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtin%2Fstream-flow-async/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtin%2Fstream-flow-async/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtin%2Fstream-flow-async/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devtin","download_url":"https://codeload.github.com/devtin/stream-flow-async/tar.gz/refs/heads/development","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devtin%2Fstream-flow-async/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30025311,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T23:36:48.274Z","status":"ssl_error","status_checked_at":"2026-03-02T23:33:36.569Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2025-03-01T02:48:07.019Z","updated_at":"2026-03-02T23:38:41.627Z","avatar_url":"https://github.com/devtin.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# stream-flow-async\n\nA utility wrapper to asynchronously post-process data from a Readable stream that controls the stream flow to a maximum\namount of concurrent un-resolved async operations in order to avoid\n\u003ca href=\"https://nodejs.org/es/docs/guides/backpressuring-in-streams/\" target=\"_blank\"\u003eback-pressuring\u003c/a\u003e.\n\n## Usage\n\n```js\nconst fs = require('fs');\nconst { streamFlowAsync } = require('stream-flow-async');\nconst db = require('./my-db-conntection.js');\n\nconst stream = fs.createReadStream('emails.txt');\n\nconst saveInDb = (email) =\u003e {\n  return db.collection('emails').insertOne({ email })\n}\n\nstreamFlowAsync({\n    stream, // the stream\n    handler: saveInDb, // an async function handler that will receive each chunk\n    flow: 10 // maximum amount of concurrent un-resolved async functions\n  })\n  .then(() =\u003e {\n    console.log('all saved!')\n  })\n```\n\n### An example using csv-parser\n\n```js\nconst fs = require('fs');\nconst csv = require('csv-parser');\nconst db = require('./my-db-conntection.js');\n\nconst stream = fs.createReadStream('millions-of-contacts.csv').pipe(csv());\n\nconst saveInDb = (contact) =\u003e {\n  return db.collection('contacts').insertOne(contact)\n}\n\nstreamFlowAsync({\n    stream,\n    handler: saveInDb, // receives each csv line parsed\n    flow: 100\n  })\n  .then(() =\u003e {\n    console.log('all saved!')\n  })\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevtin%2Fstream-flow-async","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevtin%2Fstream-flow-async","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevtin%2Fstream-flow-async/lists"}