wubin1998 / node-download

node download file module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

node-download

npm version

使用方法

npm install node-download-file --save

File(URL, dir, filename[Optional])

var download = require('node-download-file')

download.File("http://o6httuwar.bkt.clouddn.com/2202-ntk39234.jpg","./public/", null)
.then( (result) => {
  if (result == 200) {
    console.log('下载完成')
  }
})

文件流

FileStream(URL, dir, filename[Optional])

download.FileStream("http://o6httuwar.bkt.clouddn.com/2202-ntk39234.jpg","./", null)
.then( (result) => {
  if (result == 200) {
    console.log('下载完成')
  }
})

About

node download file module

License:MIT License


Languages

Language:JavaScript 100.0%