smarthash/ts/nodehash.helpers.ts
2016-08-16 03:37:40 +02:00

16 lines
327 B
TypeScript

import * as plugins from "./nodehash.plugins";
export let hashStreamPipeStop = (resolveFuntion) => {
let forEach = (chunk:Buffer,enc,cb) => {
resolveFuntion(chunk.toString("utf8"));
cb(null,chunk);
};
let atEnd = (cb) => {
cb();
};
return plugins.through2(forEach,atEnd);
};