smarthash/ts/nodehash.helpers.ts

16 lines
327 B
TypeScript
Raw Normal View History

2016-08-16 01:37:40 +00:00
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);
};