Skip to content

Instantly share code, notes, and snippets.

@esayler
Last active April 3, 2017 23:29
Show Gist options
  • Save esayler/bc00a91b618bf3c7c519af962463153b to your computer and use it in GitHub Desktop.
Save esayler/bc00a91b618bf3c7c519af962463153b to your computer and use it in GitHub Desktop.
let stream = progress({ time: 50 })
stream.on('progress', progress => {
mainWindow.setProgressBar(progress.percentage / 100.0)
})
request
.get(url)
.pipe(stream)
.pipe(fs.createWriteStream(path))
.on('close', finished)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment