Download a file to disk programmatically
npm install download-to-fileDownload a file to disk programmatically.


```
npm install download-to-file --save
`js
var download = require('download-to-file')
console.log('Downloading to /tmp/example.html')
download('http://example.com/', '/tmp/example.html', function (err, filepath) {
if (err) throw err
console.log('Download finished:', filepath)
})
`
Will download the content of the given url and store it in a filefilepath
specified by . When done, the callback will be called withfilepath` as the
an optional error object as the first argument and the
second argument.
If the server does not return a 200 HTTP status code, the callback will
be called with an error and the file will not be stored on disk.
MIT