download
Download and extract files

download downloads download version download license

download유사 패키지:
npm 다운로드 트렌드
3 년
🌟 download의 README.md에 실시간 사용 차트를 표시하려면 아래 코드를 복사하세요.
## Usage Trend
[![Usage Trend of download](https://npm-compare.com/img/npm-trend/THREE_YEARS/download.png)](https://npm-compare.com/download#timeRange=THREE_YEARS)
Cumulative GitHub Star Trend
🌟 download의 README.md에 GitHub Stars 트렌드 차트를 표시하려면 아래 코드를 복사하세요.
## GitHub Stars Trend
[![GitHub Stars Trend of download](https://npm-compare.com/img/github-trend/download.png)](https://npm-compare.com/download)
통계 세부사항
패키지
다운로드
Stars
크기
Issues
발행일
라이선스
download2,030,6361,299-666年前MIT
download의 README

download Build Status

Download and extract files

See download-cli for the command-line version.

Install

$ npm install download

Usage

const fs = require('fs');
const download = require('download');

(async () => {
	await download('http://unicorn.com/foo.jpg', 'dist');

	fs.writeFileSync('dist/foo.jpg', await download('http://unicorn.com/foo.jpg'));

	download('unicorn.com/foo.jpg').pipe(fs.createWriteStream('dist/foo.jpg'));

	await Promise.all([
		'unicorn.com/foo.jpg',
		'cats.com/dancing.gif'
	].map(url => download(url, 'dist')));
})();

Proxies

To work with proxies, read the got documentation.

API

download(url, destination?, options?)

Returns both a Promise<Buffer> and a Duplex stream with additional events.

url

Type: string

URL to download.

destination

Type: string

Path to where your file will be written.

options

Type: Object

Same options as got and decompress in addition to the ones below.

extract

Type: boolean
Default: false

If set to true, try extracting the file using decompress.

filename

Type: string

Name of the saved file.