How to use the pipeline function from readable-stream

Find comprehensive JavaScript readable-stream.pipeline code examples handpicked from public code repositorys.

22
23
24
25
26
27
28
29
30
31
const ejs = require('gulp-ejs');
const fg = require('fast-glob');

// 从public压缩复制文件到build
function minifyJs() {
  return pipeline(src('public/**/*.js'), uglifyjs(), dest('build'));
}

function minifyCss() {
  return src('public/**/*.css').pipe(cleanCSS()).pipe(dest('build'));
fork icon319
star icon0
watch icon51

77
78
79
80
81
82
83
84
85
86
87
  // ignore any data after footerOffset and push footerBuffer
  //
  // this is necessary to ignore any blank space between the last block and the
  // final footer which would invalidate the size we computed
  const newStream = new EndCutterStream(footerOffset, footerBuffer)
  pipeline(stream, newStream, noop)


  newStream.length = footerOffset + FOOTER_SIZE
  return newStream
}
fork icon206
star icon571
watch icon0

94
95
96
97
98
99
100
101
102
  if (readableClosed && writableClosed && !this[_closed]) {
    this.close();
  }
};

pipeline(this[_input], handshake, err => {
  if (err) {
    this.emit('error', err);
  }
fork icon2
star icon8
watch icon2

151
152
153
154
155
156
157
158
159
160
debug('using snapshot: %s', snapshot);

const ops = [];
let count = 0;

pipeline(
  db.createKeyStream(allRanks),
  new Transform({
    objectMode: true,
    transform(chunk, _enc, transformCallback) {
fork icon0
star icon5
watch icon1

+ 3 other calls in file

36
37
38
39
40
41
42
43
44
45
46
47
})


test('EntryStream', function (t) {
  t.plan(2)


  pipeline(new EntryStream(db), new Concat((acc) => {
    t.same(acc, data)
  }), t.ifError.bind(t))
})

fork icon1
star icon2
watch icon0

+ 2 other calls in file