{"id":13526571,"url":"https://github.com/bendrucker/stream-to-promise","last_synced_at":"2025-05-16T07:07:47.884Z","repository":{"id":15081709,"uuid":"17808137","full_name":"bendrucker/stream-to-promise","owner":"bendrucker","description":"Convert streams (readable or writable) to promises","archived":false,"fork":false,"pushed_at":"2024-06-10T17:10:23.000Z","size":45,"stargazers_count":139,"open_issues_count":0,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-13T18:12:14.818Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ammmir/node-oauth2-provider","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bendrucker.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":"2014-03-16T20:13:09.000Z","updated_at":"2024-06-29T04:12:30.000Z","dependencies_parsed_at":"2024-01-16T00:14:31.309Z","dependency_job_id":"f6fe2213-59b1-4c2d-baa0-bb84ba240df1","html_url":"https://github.com/bendrucker/stream-to-promise","commit_stats":{"total_commits":74,"total_committers":10,"mean_commits":7.4,"dds":"0.22972972972972971","last_synced_commit":"284fa8cbaac77cfd34a8a95f56e684864555b50a"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fstream-to-promise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fstream-to-promise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fstream-to-promise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bendrucker%2Fstream-to-promise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bendrucker","download_url":"https://codeload.github.com/bendrucker/stream-to-promise/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254485064,"owners_count":22078767,"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-08-01T06:01:31.659Z","updated_at":"2025-05-16T07:07:42.875Z","avatar_url":"https://github.com/bendrucker.png","language":"JavaScript","funding_links":[],"categories":["Repository","JavaScript","Modules"],"sub_categories":["Streams"],"readme":"# stream-to-promise [![Build Status](https://travis-ci.com/bendrucker/stream-to-promise.svg?branch=master)](https://travis-ci.com/bendrucker/stream-to-promise)\n\n\u003e Convert streams (readable or writable) to promises\n\n## Installing\n\n```sh\nnpm install --save stream-to-promise\n```\n\n## Examples\n\n### Readable Streams\n\n```js\nstreamToPromise(readableStream).then(function (buffer) {\n  // buffer.length === 3\n})\nreadableStream.emit('data', new Buffer())\nreadableStream.emit('data', new Buffer())\nreadableStream.emit('data', new Buffer())\nreadableStream.emit('end') // promise is resolved here\n```\n\n### Writable Streams\n\n```js\nstreamToPromise(writableStream).then(function () {\n  // resolves undefined\n})\nwritableStream.write('data')\nwritableStream.end() // promise is resolved here\n```\n\n### Error Handling\n\n```js\nconst err = new Error()\nstreamToPromise(stream).catch(function (error) {\n  // error === err\n})\nstream.emit('error', err) // promise is rejected here\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Fstream-to-promise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbendrucker%2Fstream-to-promise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbendrucker%2Fstream-to-promise/lists"}