{"id":13526635,"url":"https://github.com/schnittstabil/stream-from-promise","last_synced_at":"2025-10-14T20:37:15.902Z","repository":{"id":18531616,"uuid":"21732172","full_name":"schnittstabil/stream-from-promise","owner":"schnittstabil","description":"Create streams from promises","archived":false,"fork":false,"pushed_at":"2016-02-24T19:35:51.000Z","size":18,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-14T20:37:14.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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/schnittstabil.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}},"created_at":"2014-07-11T10:21:46.000Z","updated_at":"2019-08-06T13:58:22.000Z","dependencies_parsed_at":"2022-08-05T00:00:47.397Z","dependency_job_id":null,"html_url":"https://github.com/schnittstabil/stream-from-promise","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/schnittstabil/stream-from-promise","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schnittstabil%2Fstream-from-promise","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schnittstabil%2Fstream-from-promise/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schnittstabil%2Fstream-from-promise/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schnittstabil%2Fstream-from-promise/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/schnittstabil","download_url":"https://codeload.github.com/schnittstabil/stream-from-promise/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/schnittstabil%2Fstream-from-promise/sbom","scorecard":{"id":804174,"data":{"date":"2025-08-11","repo":{"name":"github.com/schnittstabil/stream-from-promise","commit":"3af7ec9fe6b1de6addd184c2707a9d38d3c2d0f3"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/11 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: MIT License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-23T11:19:35.587Z","repository_id":18531616,"created_at":"2025-08-23T11:19:35.587Z","updated_at":"2025-08-23T11:19:35.587Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279020904,"owners_count":26086949,"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","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2024-08-01T06:01:32.467Z","updated_at":"2025-10-14T20:37:15.869Z","avatar_url":"https://github.com/schnittstabil.png","language":"JavaScript","funding_links":[],"categories":["Repository","Modules"],"sub_categories":["Streams"],"readme":"# stream-from-promise [![Dependencies Status Image](https://gemnasium.com/schnittstabil/stream-from-promise.svg)](https://gemnasium.com/schnittstabil/stream-from-promise) [![Build Status Image](https://travis-ci.org/schnittstabil/stream-from-promise.svg)](https://travis-ci.org/schnittstabil/stream-from-promise) [![Coverage Status](https://coveralls.io/repos/schnittstabil/stream-from-promise/badge.png)](https://coveralls.io/r/schnittstabil/stream-from-promise)\n\nCreate streams from [ECMAScript 2015 Promises](http://www.ecma-international.org/ecma-262/6.0/#sec-promise-objects).\n\n```bash\nnpm install stream-from-promise --save\n```\n\n\n## Usage\n\n\n### `String | Buffer` promises\n\n```JavaScript\nimport StreamFromPromise from 'stream-from-promise';\n\nconst stringPromise = new Promise((resolve, reject) =\u003e {\n  setTimeout(() =\u003e {\n    resolve('strrrring!');\n  }, 500);\n});\n\nStreamFromPromise(stringPromise)\n  .pipe(process.stdout); // output: strrrring!\n\n\nconst bufferPromise = new Promise((resolve, reject) =\u003e {\n  setTimeout(() =\u003e {\n    resolve(new Buffer('buff!'));\n  }, 500);\n});\n\nStreamFromPromise(bufferPromise)\n  .pipe(process.stdout); // output: buff!\n```\n\n\n### Arbitrary Promises\n\n```JavaScript\nimport StreamFromPromise from 'stream-from-promise';\n\nconst funcPromise = new Promise((resolve, reject) =\u003e {\n  setTimeout(() =\u003e {\n    resolve(() =\u003e {\n      console.log('func!?!');\n    });\n  }, 500);\n});\n\nStreamFromPromise.obj(funcPromise)\n  .on('data', fn =\u003e {\n    fn(); // output: func!?!\n  });\n```\n\n\n### Rejecting\n\n```JavaScript\nimport StreamFromPromise from 'stream-from-promise';\n\nconst rejectPromise = new Promise((resolve, reject) =\u003e {\n  setTimeout(() =\u003e {\n    reject(new Error('rejected'));\n  }, 500);\n});\n\nStreamFromPromise(rejectPromise)\n  .on('error', err =\u003e {\n    console.log(err); // output: [Error: rejected]\n  })\n  .on('data', data =\u003e {\n    // do something awsome\n  });\n```\n\n\n### [Gulp](http://gulpjs.com/) File promises\n\nGulp files are [vinyl](https://github.com/wearefractal/vinyl) files:\n\n```bash\nnpm install vinyl\n```\n\nTest some awsome Gulp plugin:\n\n```JavaScript\nimport StreamFromPromise from 'stream-from-promise';\nimport File from 'vinyl';\n\nconst hello = new File({\n      cwd: '/',\n      base: '/hello/',\n      path: '/hello/hello.js',\n      contents: new Buffer('console.log(\"Hello\");')\n    });\n\nconst helloFilePromise = new Promise((resolve, reject) =\u003e {\n  setTimeout(() =\u003e {\n    resolve(hello);\n  }, 500);\n});\n\nStreamFromPromise.obj(helloFilePromise)\n  .pipe(someAwsomeGulpPlugin())\n  .on('data', file =\u003e {\n    console.log(file.contents.toString()); // dunno what someAwsomeGulpPlugin does :)\n  });\n```\n\nSee also [stream-recorder](https://github.com/schnittstabil/stream-recorder) for testing gulp plugins.\n\n\n## API\n\n\n### Class: StreamFromPromise\n\n_StreamFromPromises_ are [Readable](http://nodejs.org/api/stream.html#stream_class_stream_readable_1) streams.\n\n\n#### new StreamFromPromise(promise, [options])\n\n* _promise_ `Promise` ECMAScript 2015 Promises returning Javascript values like numbers, strings, objects, functions, ...\n* _options_ `Object` passed through [new Readable([options])](http://nodejs.org/api/stream.html#stream_new_stream_readable_options)\n\nNote: The `new` operator can be omitted.\n\n\n#### StreamFromPromise#obj(promise, [options])\n\nA convenience wrapper for `new StreamFromPromise(promise, {objectMode: true, ...})`.\n\n\n## License\n\nMIT © [Michael Mayer](http://schnittstabil.de)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschnittstabil%2Fstream-from-promise","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fschnittstabil%2Fstream-from-promise","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fschnittstabil%2Fstream-from-promise/lists"}