benchmarkResults[name] = {} const processor = through(function (line, enc, cb) { const [label, time] = ('' + line).split(': ') const [target, iterations] = label.split('*')
http.createServer(function (req, res) { if (req.method === 'POST') { req .pipe(through(write, end)) .pipe(res) } else res.end('thingy.txt') })
through((chunk, _, callback) => { try { let { id, level, name, message } = JSON.parse(chunk) const color = levels[level] id = id ? ` ${chalk.blue(id)} ` : ' ' message = typeof message === 'object' ? JSON.stringify(message, null, 2) : message console.log(`${color(level)}${id}(${chalk.cyan(name)}) ${message}`) callback(null, chunk) } catch (err) { callback(err) } })
process.stdin .pipe(split()) .pipe(through(function (line, _, next) { this.push(lineNumber % 2 === 0 ? line.toString().toUpperCase()+'\n' : line.toString().toLowerCase()+'\n' ) lineNumber++ next() })) .pipe(process.stdout)
function transform() { const stream = through(write, end); process.stdout.write('Please, enter a string: '); process.stdin .pipe(stream) .pipe(process.stdout) .on('error', errorHandler); }
constructor (options = {}) { this.threshold = MAX_INT16 this.lastPeakDistance = MAX_UINT32 this.slidingWindowMax = new SlidingWindowMax(SAMPLES_WINDOW, {waitFullRange: false}) this.pos = 0 this.sensitivity = options.sensitivity || 0.6 this.debugFilter = options.debugFilter this.plotter = options.plotter this.scheduler = options.scheduler this.minThreashold = options.minThreashold || MAX_INT16 * 0.05 this.leftFilter = this._getBandFilter() this.rightFilter = this._getBandFilter() const analyzeBuffer = this._analyzeBuffer.bind(this) this.through = through(function (packet, enc, cb) { const stream = this analyzeBuffer(stream, packet, cb) }) }
through(function(buf, enc, next) { this.push( buf.toString('utf-8') .replace(regex, '') ); next(); })
realRes.pipe(through(function(chunk, enc, callback) { let chunkString = chunk.toString();
through(function (data, _, next) { if (limit && called >= limit) { complete();
/** * preactify */ function preactify() { return through( function (buf, enc, next) { var code = buf.toString('utf-8') .replace('import React from \'react\';', 'import Preact from \'preact\';') .replace('React.', 'Preact.'); this.push(code); next(); } ); }
var docstream = stores.docStore.readStream(readstreamOpts); var throughStream = through(function (entry, _, next) { var metadata = entry.value;
http.createServer(function (req, res) { if (req.method === 'POST') { req.pipe(split()) .pipe(through(write, end)) } res.end() })
const outputStream = through()
through((chunk, _, callback) => { try { let { id, level, name, message } = JSON.parse(chunk) const color = levels[level] id = id ? ` ${chalk.blue(id)} ` : ' ' message = typeof message === 'object' ? JSON.stringify(message, null, 2) : message console.log(`${color(level)}${id}(${chalk.cyan(name)}) ${message}`) callback(null, chunk) } catch (err) { callback(err) } })