Instantly share code, notes, and snippets.

Embed
What would you like to do?
const progressHelper = require('./progressHelper.js')
const handler = ({loaded, total}) => {
console.log(`Downloaded ${loaded} of ${total}`)
}
// handler args: ({ loaded = Kb, total = 0-100% })
const streamProcessor = progressHelper(handler)
// => streamProcessor is a function for use with the response _stream_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment