Friday 21 April 2017

NodeJS get a count of bytes of streaming file download

In this code I stream a file from a url and save it to a file. Is there a way to also pipe it through something that will count the number of bytes piped? (Which would tell me the file size.)

  request.stream(url)
    .pipe(outputFile)

Is there some library that would do this by piping the download through it, or a simple way for me to do it myself?



via user779159

No comments:

Post a Comment