{"id":16841627,"url":"https://github.com/kevinpollet/fetch-pkg","last_synced_at":"2025-03-23T15:31:37.339Z","repository":{"id":48332987,"uuid":"217215364","full_name":"kevinpollet/fetch-pkg","owner":"kevinpollet","description":"Fetch packages from any npm-compatible registry","archived":false,"fork":false,"pushed_at":"2021-08-01T01:21:25.000Z","size":108,"stargazers_count":3,"open_issues_count":17,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T21:54:30.928Z","etag":null,"topics":["download","fetch","github-package-registry","metadata","npm","package","stream"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/kevinpollet.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2019-10-24T05:03:56.000Z","updated_at":"2020-09-24T18:29:42.000Z","dependencies_parsed_at":"2022-09-09T02:20:08.791Z","dependency_job_id":null,"html_url":"https://github.com/kevinpollet/fetch-pkg","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinpollet%2Ffetch-pkg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinpollet%2Ffetch-pkg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinpollet%2Ffetch-pkg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinpollet%2Ffetch-pkg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevinpollet","download_url":"https://codeload.github.com/kevinpollet/fetch-pkg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245122860,"owners_count":20564397,"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":["download","fetch","github-package-registry","metadata","npm","package","stream"],"created_at":"2024-10-13T12:42:32.608Z","updated_at":"2025-03-23T15:31:36.642Z","avatar_url":"https://github.com/kevinpollet.png","language":"TypeScript","readme":"# fetch-pkg \u003c!-- omit in toc --\u003e\n\n[![Build Status](https://github.com/kevinpollet/fetch-pkg/workflows/build/badge.svg)](https://github.com/kevinpollet/fetch-pkg/actions)\n[![Coverage Status](https://coveralls.io/repos/github/kevinpollet/fetch-pkg/badge.svg)](https://coveralls.io/github/kevinpollet/fetch-pkg)\n[![npm Latest Version](https://img.shields.io/npm/v/fetch-pkg/latest)](https://www.npmjs.com/package/fetch-pkg)\n[![npm Downloads](https://img.shields.io/npm/dm/fetch-pkg)](https://www.npmjs.com/package/fetch-pkg)\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)\n[![Code Style: Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n[![License](https://img.shields.io/github/license/kevinpollet/fetch-pkg)](./LICENSE.md)\n[![GitHub stars](https://img.shields.io/github/stars/kevinpollet/fetch-pkg?style=social)](https://github.com/kevinpollet/fetch-pkg/stargazers)\n[![Twitter Follow](https://img.shields.io/twitter/follow/kevinpollet?style=social)](https://twitter.com/kevinpollet)\n\nFetch packages from any npm-compatible registry.\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cstrong\u003eTable of Contents\u003c/strong\u003e (click to expand)\u003c/summary\u003e\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [API](#api)\n- [Contributing](#contributing)\n- [License](#license)\n\n\u003c/details\u003e\n\n## Installation\n\n```shell\nnpm install --save fetch-pkg   # npm\nyarn add fetch-pkg             # Yarn\n```\n\n## Usage\n\n```typescript\nimport fs from \"fs\";\nimport { fetchPkg } from \"fetch-pkg\";\n\nfetchPkg(\"fetch-pkg\")\n  .then(pkg =\u003e\n    pkg\n      .pipe(fs.createWriteStream(\"inception.tgz\"))\n      .once(\"finish\", () =\u003e process.exit(0))\n  )\n  .catch(err =\u003e {\n    console.error(err);\n    process.exit(1);\n  });\n```\n\n## API\n\n### fetchPkg(name: string, opts?: [Options](#options)): Promise\u003c[Pkg](#pkg)\u003e \u003c!-- omit in toc --\u003e\n\nFetch a package from an npm-compatible registry and return the fetch package metadata and tarball stream.\n\n### Pkg \u003c!-- omit in toc --\u003e\n\nExtends: `stream.Readable`\n\n#### name \u003c!-- omit in toc --\u003e\n\n- Type: `string`\n\nThe fetched package name.\n\n#### version \u003c!-- omit in toc --\u003e\n\n- Type: `string`\n\nThe fetched package version.\n\n### Options \u003c!-- omit in toc --\u003e\n\n#### registryURL \u003c!-- omit in toc --\u003e\n\n- Type: `string`\n- Default: `https://registry.npmjs.org/`\n\nThe package registry URL. For example, to fetch a package from the GitHub Package Registry you should use https://npm.pkg.github.com.\n\n#### token \u003c!-- omit in toc --\u003e\n\n- Type: `string`\n\nThe authentication token.\n\n#### version \u003c!-- omit in toc --\u003e\n\n- Type: `string`\n- Default: `latest`\n\nThe package version to fetch, a valid [semver range](https://github.com/npm/node-semver#ranges) or a [dist tag](https://docs.npmjs.com/cli/dist-tag).\n\n### Errors \u003c!-- omit in toc --\u003e\n\n- `FetchPkgError`: This error is thrown when something went wrong with the HTTP requests.\n- `PackageNotFoundError`: This error is thrown when the given package name cannot be found.\n- `PackageVersionNotFoundError`: This error is thrown when the given package version cannot be found.\n\n## Contributing\n\nContributions are welcome!\n\nWant to file a bug, request a feature or contribute some code?\n\n1. Check out the [Code of Conduct](./CODE_OF_CONDUCT.md).\n2. Check for an existing [issue](https://github.com/kevinpollet/fetch-pkg) matching your bug or feature request.\n3. Open an issue describing your bug or feature request.\n4. Open a pull request if you want to contribute some code.\n\n## License\n\n[MIT](./LICENSE.md)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinpollet%2Ffetch-pkg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevinpollet%2Ffetch-pkg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinpollet%2Ffetch-pkg/lists"}