Skip to content

Latest commit

 

History

History
28 lines (26 loc) · 704 Bytes

README.md

File metadata and controls

28 lines (26 loc) · 704 Bytes

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('下载完成')
  }
})