undownload
v1.0.0
Published
all in one 的 node 下载
Downloads
54
Readme
undownload
all in one
的 node
下载
features 🦕
cli
支持- 进度条支持
http
和https
支持
Usage 🦖
program
install
npm i undownload
basic
基础
import { download } from 'undownload'
// 将输出到工作区的 downloads 目录下
download('https://...')
change outDir
改变输出目录,默认为 downloads
import { download } from 'undownload'
// 将输出到工作区的 downloads/imgs 目录下
download({
url: 'https://.../foo.jpg',
outDir: 'downloads/imgs'
})
hide progress bar
隐藏进度条
import { download } from 'undownload'
download({
url: 'https://...',
showProgressBar: false
})
dest
返回结果 Promise<string>
输出路径 dest
import { download } from 'undownload'
const runDownload = async () => {
const dest = await download('https://...')
console.log(dest)
}
runDownload()
cli
install
npm i undownload -g
download
下载,url
支持 http
和 https
协议
download <url>
help
帮助
download -h
version
版本号
download -v
method
方法,支持 GET
和 POST
,默认为 GET
download <url> --method POST
outDir
下载后文件的输出目录,默认为 downloads
download <url> --outDir downloads/imgs
showProgressBar
显示进度条,默认为 true
download <url> --showProgressBar false
License
Made with markthree
Published under MIT License.