{"id":16186204,"url":"https://github.com/zenflow/node-fast-download","last_synced_at":"2025-03-19T03:30:28.612Z","repository":{"id":57232958,"uuid":"10924226","full_name":"zenflow/node-fast-download","owner":"zenflow","description":"node module and command-line program for accelerated (multiple connections) http download Stream","archived":false,"fork":false,"pushed_at":"2019-01-14T12:19:22.000Z","size":62,"stargazers_count":30,"open_issues_count":7,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T14:44:18.827Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zenflow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-25T00:39:33.000Z","updated_at":"2021-10-05T22:36:09.000Z","dependencies_parsed_at":"2022-08-31T20:51:08.908Z","dependency_job_id":null,"html_url":"https://github.com/zenflow/node-fast-download","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenflow%2Fnode-fast-download","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenflow%2Fnode-fast-download/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenflow%2Fnode-fast-download/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zenflow%2Fnode-fast-download/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zenflow","download_url":"https://codeload.github.com/zenflow/node-fast-download/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243961585,"owners_count":20375276,"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-10T07:17:35.200Z","updated_at":"2025-03-19T03:30:28.339Z","avatar_url":"https://github.com/zenflow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# node-fast-download\r\n\r\nnode module and command-line program for accelerated (multiple connections) http download Stream\r\n\r\n[![dependencies](https://david-dm.org/zenflow/node-fast-download.svg)](https://david-dm.org/zenflow/node-fast-download)\r\n[![dev-dependencies](https://david-dm.org/zenflow/node-fast-download/dev-status.svg)](https://david-dm.org/zenflow/node-fast-download#info=devDependencies)\r\n\r\n[![npm](https://nodei.co/npm/fast-download.svg?downloads=true\u0026downloadRank=true\u0026stars=true)](https://www.npmjs.com/package/fast-download)\r\n\r\n# install\r\n\r\n`$ npm install -g fast-download` to install as a command-line program or `$ npm install --save fast-download` to add it to your project\r\n\r\n# command-line usage\r\n\r\n```\r\n$ fast-download -h\r\n\r\n  Usage: fast-download [options] \u003curls\u003e\r\n\r\n  Options:\r\n\r\n    -h, --help             output usage information\r\n    -V, --version          output the version number\r\n    -d, --directory \u003cs\u003e    destination directory (default: current working directory)\r\n    -f, --filename \u003cs\u003e     destination filename (default: base filename in url)\r\n    -o, --overwrite        overwrite existing file (default is to resume)\r\n    -c --chunksAtOnce \u003cn\u003e  the number of data chunks to download at the same time (default: 3)\r\n    -s --chunkSize \u003cn\u003e     the size of a data chunk in MB (default: 0, meaning file size divided by chunksAtOnce)\r\n    -t, --timeout          timeout on http requests in seconds (default: 0, meaning no timeout)\r\n    -w, --width \u003cn\u003e        display width (default: 72)\r\n```\r\n\r\n# module usage\r\n\r\n## example\r\n\r\n``` js\r\nvar FastDownload = require('fast-download');\r\nvar dl = new FastDownload(url, options);\r\ndl.on('error', function(error){throw error;})\r\ndl.on('start', function(dl){console.log('started');})\r\ndl.on('end', function(){console.log('ended');});\r\ndl.pipe(fs.createReadStream('foo.bar'));\r\n```\r\n\r\nor use the constructor callback instead of the `'start'` event (you may use both together)\r\n\r\n```js\r\nvar FastDownload = require('fast-download');\r\nnew FastDownload(url, options, function(error, dl){\r\n    if (error){throw error;}\r\n    console.log('started');\r\n    dl.on('error', function(error){throw error;});\r\n    dl.on('end', function(){console.log('ended');});\r\n    dl.pipe(fs.createReadStream('foo.bar'));\r\n});\r\n```\r\n\r\nonce the `'start'` event has fired, you can access `dl.headers`, `dl.chunks`, and other data members\r\n\r\n## options\r\n\r\n`'destFile'` if set, download is written to this file location. default: null\r\n\r\n`'resumeFile'` if `'destFile'` is set and `'resumeFile'` is true, the download will start where the existing file leaves off. default: false\r\n\r\n`'start'` the starting position in bytes. default: 0\r\n\r\n`'end'` the ending position in bytes. default: null (end of file)\r\n\r\n`'chunksAtOnce'` the maximum number of chunks to download at a time. default: 3\r\n\r\n`'chunkSize'` the size of each chunk in bytes. default: null (download size divided by `'chunksAtOnce'`)\r\n\r\n# Changelog\r\n### v0.3.5\r\n* Added changelog lol\r\n* Don't rely on sketchy `request` `'end'` event\r\n* Added badges/shields to readme","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenflow%2Fnode-fast-download","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzenflow%2Fnode-fast-download","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzenflow%2Fnode-fast-download/lists"}