pump(benchmark.stdout, split(), processor)
/** * Return a readable stream for file. * * `fileStream.path` is the specified file ID i.e. `fileId`. * `fileStream` emits event `info` passing a single argument i.e. * `info` with the interface `{ uri }` where `uri` is the URI of the * file on Telegram servers. * * This method is a sugar extension of the [getFileLink](#TelegramBot+getFileLink) method, * which returns the full URI to the file on remote server. * * @param {String} fileId File identifier to get info about * @param {Object} [options] Additional Telegram query options * @return {stream.Readable} fileStream */ getFileStream(fileId, form = {}) { const fileStream = new stream.PassThrough(); fileStream.path = fileId; this.getFileLink(fileId, form) .then((fileURI) => { fileStream.emit('info', { uri: fileURI, }); pump(streamedRequest(Object.assign({ uri: fileURI }, this.options.request)), fileStream); }) .catch((error) => { fileStream.emit('error', error); }); return fileStream; }
pump(fileStream, fs.createWriteStream(filePath), (error) => { if (error) { return reject(error); } return resolve(filePath);
pump(readBuffer, ws, split2(), err => err ? reject(err) : /* istanbul ignore next */ null) .on('data', (authToken) => { let err
async getWatchObjectStream (options) { const jsonStream = new JSONStream() const stream = this.http(Object.assign({ stream: true }, options)) pump(stream, jsonStream) return jsonStream }
function compressImage(image, options, res, gcsStream) { const writeStream = concatStream(handleCompression); pump(image.stream, writeStream, err => { if(err) {
gulp.task("apis", function(cb) { pump([ gulp.src("apis/**/*.js"), gulp.dest("modbus-serial/apis") ], cb ); });
gulp.task(MINIFY_CSS, function(cb) { pump([ gulp.src(CSS_SRC), cleanCSS(), gulp.dest(CSS_DIST) ], cb); });
/** * Clean Task */ gulp.task(CLEAN, function(cb) { pump([ gulp.src(BASE_DIST_DIR, {read: false}), clean({force: true}) ], cb); });
gulp.task(MOVE_REQUIRE_CSS, function(cb) { pump([ gulp.src(REQUIRE_CSS_SRC), uglify({ mangle: true }), gulp.dest(REQUIRE_CSS_DIST) ], cb) });
/** * Moving Resources Tasks */ gulp.task(MOVE_HTML, function(cb) { pump([ gulp.src(HTML_SRC), gulp.dest(HTML_DIST) ], cb); });
/** * Moving Resources Tasks */ gulp.task(MOVE_HTML, function(cb) { pump([ gulp.src(HTML_SRC), gulp.dest(HTML_DIST) ], cb); });
gulp.task(MOVE_LIB, function(cb) { pump([ gulp.src(LIB_SRC), gulp.dest(LIB_DIST) ], cb); });
/** * Make sure we have a .gitignore file in the dist folder itself * to avoid causing version control problems. */ gulp.task('ignore', ['copy'], function () { pump([ gulp.src('logs/.gitignore'), gulp.dest('dist') ]); });
gulp.task("utils", function(cb) { pump([ gulp.src("utils/**/*.js"), gulp.dest("modbus-serial/utils") ], cb ); });