{"id":13527435,"url":"https://github.com/kevva/download","last_synced_at":"2025-05-14T00:07:02.733Z","repository":{"id":41967536,"uuid":"12325488","full_name":"kevva/download","owner":"kevva","description":"Download and extract files","archived":false,"fork":false,"pushed_at":"2023-10-08T19:06:13.000Z","size":250,"stargazers_count":1293,"open_issues_count":66,"forks_count":204,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-03-12T08:11:10.896Z","etag":null,"topics":["async","decompress","download","extract","http","nodejs","promise","stream"],"latest_commit_sha":null,"homepage":"","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/kevva.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":"2013-08-23T14:49:56.000Z","updated_at":"2025-03-08T19:29:23.000Z","dependencies_parsed_at":"2024-06-18T11:13:55.881Z","dependency_job_id":null,"html_url":"https://github.com/kevva/download","commit_stats":{"total_commits":272,"total_committers":23,"mean_commits":"11.826086956521738","dds":"0.24632352941176472","last_synced_commit":"94e9081e461719b61e62050704cdfcc6a464d6a7"},"previous_names":[],"tags_count":69,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevva%2Fdownload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevva%2Fdownload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevva%2Fdownload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevva%2Fdownload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevva","download_url":"https://codeload.github.com/kevva/download/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243830954,"owners_count":20354855,"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":["async","decompress","download","extract","http","nodejs","promise","stream"],"created_at":"2024-08-01T06:01:47.870Z","updated_at":"2025-03-19T20:40:40.648Z","avatar_url":"https://github.com/kevva.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Repository","GIT 仓库","Packages","包","nodejs","http","HTTP","目录","Uncategorized","1. 后端开发"],"sub_categories":["HTTP","Uncategorized","1.1 HTTP"],"readme":"# download [![Build Status](https://travis-ci.org/kevva/download.svg?branch=master)](https://travis-ci.org/kevva/download)\n\n\u003e Download and extract files\n\n*See [download-cli](https://github.com/kevva/download-cli) for the command-line version.*\n\n\n## Install\n\n```\n$ npm install download\n```\n\n\n## Usage\n\n```js\nconst fs = require('fs');\nconst download = require('download');\n\n(async () =\u003e {\n\tawait download('http://unicorn.com/foo.jpg', 'dist');\n\n\tfs.writeFileSync('dist/foo.jpg', await download('http://unicorn.com/foo.jpg'));\n\n\tdownload('unicorn.com/foo.jpg').pipe(fs.createWriteStream('dist/foo.jpg'));\n\n\tawait Promise.all([\n\t\t'unicorn.com/foo.jpg',\n\t\t'cats.com/dancing.gif'\n\t].map(url =\u003e download(url, 'dist')));\n})();\n```\n\n### Proxies\n\nTo work with proxies, read the [`got documentation`](https://github.com/sindresorhus/got#proxies).\n\n\n## API\n\n### download(url, destination?, options?)\n\nReturns both a `Promise\u003cBuffer\u003e` and a [Duplex stream](https://nodejs.org/api/stream.html#stream_class_stream_duplex) with [additional events](https://github.com/sindresorhus/got#streams-1).\n\n#### url\n\nType: `string`\n\nURL to download.\n\n#### destination\n\nType: `string`\n\nPath to where your file will be written.\n\n#### options\n\nType: `Object`\n\nSame options as [`got`](https://github.com/sindresorhus/got#options) and [`decompress`](https://github.com/kevva/decompress#options) in addition to the ones below.\n\n##### extract\n\nType: `boolean`\u003cbr\u003e\nDefault: `false`\n\nIf set to `true`, try extracting the file using [`decompress`](https://github.com/kevva/decompress).\n\n##### filename\n\nType: `string`\n\nName of the saved file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevva%2Fdownload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevva%2Fdownload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevva%2Fdownload/lists"}