{"id":16244600,"url":"https://github.com/indexzero/npm-package-buffer","last_synced_at":"2025-07-22T01:32:10.071Z","repository":{"id":66035822,"uuid":"39404715","full_name":"indexzero/npm-package-buffer","owner":"indexzero","description":"Buffers entries from a tar.Parse() stream for an npm package into memory","archived":false,"fork":false,"pushed_at":"2015-07-21T07:31:28.000Z","size":166,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-10T01:06:47.778Z","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/indexzero.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":"2015-07-20T19:41:04.000Z","updated_at":"2024-07-03T09:11:48.000Z","dependencies_parsed_at":"2023-02-19T21:45:19.107Z","dependency_job_id":null,"html_url":"https://github.com/indexzero/npm-package-buffer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/indexzero/npm-package-buffer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexzero%2Fnpm-package-buffer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexzero%2Fnpm-package-buffer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexzero%2Fnpm-package-buffer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexzero%2Fnpm-package-buffer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/indexzero","download_url":"https://codeload.github.com/indexzero/npm-package-buffer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/indexzero%2Fnpm-package-buffer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265524176,"owners_count":23781922,"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-10T14:19:53.880Z","updated_at":"2025-07-22T01:32:10.046Z","avatar_url":"https://github.com/indexzero.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# npm-package-buffer\n\nBuffers entries from a tar.Parse() stream for an npm package into memory\n\n## Usage\n\n``` js\nvar fs = require('fs');\nvar zlib = require('zlib');\nvar tar = require('tar');\nvar PackageBuffer = require('npm-package-buffer');\n\nvar parser = tar.Parse();\nvar buffer = new PackageBuffer(parser)\n  .on('error', function (err) { console.log ('tar error: %s', err); })\n  .on('end', function () {\n    //\n    // Log fully read the package.json\n    // aliased to `.pkg` as well.\n    //\n    console.dir(buffer.package);\n    console.dir(buffer.pkg);\n\n    //\n    // Log all our files in memory\n    //\n    console.dir(buffer.files);\n  });\n\n//\n// Read our tarball and pipe it to the tar parser.\n//\nfs.createReadStream('any-npm-package-1.2.3.tgz')\n  .pipe(zlib.Unzip())\n  .on('error', function (err) { console.log('zlib error: %s', err); })\n  .pipe(parser);\n```\n\n### API\n\nSee also: [`tar-buffer`](https://github.com/indexzero/tar-buffer).\n\n#### Options\n\n- `log`: (optional) Log function to use. Expects `console.log` API.\n\n#### Why isn't this a proper stream?\n\nUnderneath the covers, `tar` emits several events, not just `data` events which have to be handled seprately from a traditional stream.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findexzero%2Fnpm-package-buffer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Findexzero%2Fnpm-package-buffer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Findexzero%2Fnpm-package-buffer/lists"}