{"id":18544712,"url":"https://github.com/131/phar-stream","last_synced_at":"2025-08-24T14:26:55.817Z","repository":{"id":57322813,"uuid":"72231718","full_name":"131/phar-stream","owner":"131","description":"Nodejs PHP archive PHAR library","archived":false,"fork":false,"pushed_at":"2018-02-14T11:20:34.000Z","size":81,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-14T12:43:00.254Z","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/131.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":"2016-10-28T18:21:47.000Z","updated_at":"2019-10-21T21:56:42.000Z","dependencies_parsed_at":"2022-08-25T20:00:10.829Z","dependency_job_id":null,"html_url":"https://github.com/131/phar-stream","commit_stats":null,"previous_names":["131/node-phar"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/131/phar-stream","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fphar-stream","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fphar-stream/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fphar-stream/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fphar-stream/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/131","download_url":"https://codeload.github.com/131/phar-stream/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/131%2Fphar-stream/sbom","scorecard":{"id":1434,"data":{"date":"2025-08-11","repo":{"name":"github.com/131/phar-stream","commit":"0a63b5d0adf3d04315bbd15d60d0cf24cfee68c2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/21 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":"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":"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":"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":"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":"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":"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":"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":"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":"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":"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-14T12:37:20.797Z","repository_id":57322813,"created_at":"2025-08-14T12:37:20.798Z","updated_at":"2025-08-14T12:37:20.798Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271886648,"owners_count":24838924,"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-08-24T02:00:11.135Z","response_time":111,"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-11-06T20:17:23.107Z","updated_at":"2025-08-24T14:26:55.782Z","avatar_url":"https://github.com/131.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phar-stream\r\n\r\n[phar-stream](https://github.com/131/phar-stream) is a streaming **phar** archive ([PHP archive](https://en.wikipedia.org/wiki/PHAR_(file_format))) parser for nodejs. It is streams2 and operates purely using streams which means you can easily extract/parse phar without ever hitting the file system. phar-stream use es7 async/await syntax and require node 8+.\r\n\r\n```\r\nnpm install phar-stream\r\n```\r\n\r\n\r\n[![Build Status](https://travis-ci.org/131/phar-stream.svg?branch=master)](https://travis-ci.org/131/phar-stream)\r\n[![Coverage Status](https://coveralls.io/repos/github/131/phar-stream/badge.svg?branch=master)](https://coveralls.io/github/131/phar-stream?branch=master)\r\n[![Version](https://img.shields.io/npm/v/phar-stream.svg)](https://www.npmjs.com/package/phar-stream)\r\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](http://opensource.org/licenses/MIT)\r\n\r\n\r\n\r\n## Usage\r\n\r\nphar-stream exposes a single stream, [extract](https://github.com/131/phar-stream#extracting) which extracts phar.\r\n\r\n\r\n## Related\r\n\r\nIf you want to unpack directories on the file system check out [phar-fs](https://github.com/131/phar-fs) which provides file system bindings to this module.\r\n\r\n\r\n## Extracting\r\n\r\nTo extract a stream use `phar.extract()` and listen for `extract.on('entry', (header, stream, next) )`\r\n\r\n``` js\r\nconst phar  = require('phar-stream');\r\nconst extract = new phar.extract()\r\n\r\nextract.on('entry', function(header, stream, next) {\r\n  // header is the phar header\r\n  // stream is the content body (might be an empty stream)\r\n  // call next when you are done with this entry\r\n\r\n  stream.on('end', function() {\r\n    next() // ready for next entry\r\n  })\r\n\r\n  stream.resume() // just auto drain the stream\r\n})\r\n\r\nextract.on('finish', function() {\r\n  // all entries read\r\n})\r\n\r\n\r\n// archive = fs.createReadStream('somepath.phar');\r\narchive.pipe(extract)\r\n```\r\n\r\nThe phar archive is streamed sequentially, meaning you **must** drain each entry's stream as you get them or else the main extract stream will receive backpressure and stop reading.\r\n\r\n## Headers\r\n\r\nThe header object using in `entry` should contain the following properties.\r\nMost of these values can be found by stat'ing a file.\r\n\r\n``` js\r\n{\r\n  entry_name: 'path/to/this/entry.txt',\r\n  entry_size: 1314,        // entry size. defaults to 0\r\n  entry_mtime: new Date(), // last modified date for entry\r\n  entry_crc32: 15151, // entry CRC32 checksum\r\n}\r\n```\r\n\r\n\r\n## Todo\r\n* Implement phar-stream.pack to create phar archive (no need for now)\r\n* Get rich or die tryin'\r\n\r\n\r\n# Credits / related\r\n\r\n* [131](https://github.com/131) - author\r\n* [mafintosh' tar-stream](https://github.com/mafintosh/tar-stream) - API inspiration\r\n* [bl](https://www.npmjs.com/package/bl) Buffer list collector, reader and streamer thingy.\r\n\r\n# License\r\n\r\nMIT\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F131%2Fphar-stream","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F131%2Fphar-stream","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F131%2Fphar-stream/lists"}