Skip to content

Instantly share code, notes, and snippets.

@kharandziuk
Created August 18, 2020 07:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kharandziuk/e37787502611938086893af198a824ed to your computer and use it in GitHub Desktop.
Save kharandziuk/e37787502611938086893af198a824ed to your computer and use it in GitHub Desktop.
stream mess
const fs = require('fs')
const stream = require('stream')
const { promisify } = require('util')
const finished = promisify(stream.finished)
const handle = async (compare_object) => {
for (let [key, item] of Object.entries(compare_object)) {
var f = fs.createReadStream(item.local_path);
f.on('data', function(buf) {
});
await finished(f)
//here you call .digest
}
}
handle(compare_object)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment