How to use the batch-cluster.Deferred function in batch-cluster

To help you get started, we’ve selected a few batch-cluster examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github photostructure / exiftool-vendored.js / src / _chai.spec.ts View on Github external
export function sha1(path: string) {
  const d = new Deferred()
  const readStream = fse.createReadStream(path, { autoClose: true })
  const sha = createHash("sha1")
  readStream.on("data", ea => sha.update(ea))
  readStream.on("error", err => d.reject(err))
  readStream.on("end", () => d.resolve(sha.digest().toString("hex")))
  return d.promise
}
github photostructure / exiftool-vendored.js / src / _chai.spec.ts View on Github external
export function sha1(path: string) {
  const d = new Deferred()
  const readStream = fse.createReadStream(path, { autoClose: true })
  const sha = createHash("sha1")
  readStream.on("data", ea => sha.update(ea))
  readStream.on("error", err => d.reject(err))
  readStream.on("end", () => d.resolve(sha.digest().toString("hex")))
  return d.promise
}