How to use the readArray function from event-stream

Find comprehensive JavaScript event-stream.readArray code examples handpicked from public code repositorys.

22
23
24
25
26
27
28
29
30
31

it('should prepend text', function(done) {

  // 创建伪文件
  var fakeFile = new File({
    contents: es.readArray(['stream', 'with', 'those', 'contents'])
  });

  // 创建一个 prefixer 流(stream)
  var myPrefixer = prefixer('prependthis');
fork icon60
star icon404
watch icon31

175
176
177
178
179
180
181
182
183
184
}

if (arch === 'alpine' || platform === 'alpine') {
	const imageName = arch === 'arm64' ? 'arm64v8/node' : 'node';
	const contents = cp.execSync(`docker run --rm ${imageName}:${nodeVersion}-alpine /bin/sh -c 'cat \`which node\`'`, { maxBuffer: 100 * 1024 * 1024, encoding: 'buffer' });
	return es.readArray([new File({ path: 'node', contents, stat: { mode: parseInt('755', 8) } })]);
}

if (arch === 'armhf') {
	arch = 'armv7l';
fork icon55
star icon19
watch icon0

158
159
160
161
162
163
164
165
166
167

var lastEntry = _first(res.entries);
var lastEntryDate = null;

// prepare a stream of elements from some prepared payload
var output = es.readArray(res.entries || []);

if (!_isNil(lastEntry)) {
  if (lastEntry.mills) lastEntryDate = new Date(lastEntry.mills);
  if (!lastEntry.mills && lastEntry.date) lastEntryDate = new Date(lastEntry.date);
fork icon0
star icon0
watch icon0