Lines Matching refs:stream

6 } = require('stream');
32 const stream = Readable.from([1, 2, 3, 4, 5]).map((x) => x + x);
34 assert.deepStrictEqual(await stream.toArray(), [2, 4, 6, 8, 10]);
40 const stream = Readable.from([1, 2, 3, 4, 5]).map(async (x) => {
45 assert.deepStrictEqual(await stream.toArray(), [2, 4, 6, 8, 10]);
51 const stream = Readable.from([1, 2, 3, 4, 5]).map(async (x) => {
55 assert.deepStrictEqual(await stream.toArray(), [4, 8, 12, 16, 20]);
60 // Map works on an infinite stream
61 const stream = Readable.from(async function* () {
68 for await (const item of stream) {
77 const stream = new Readable({
88 for await (const item of stream) {
103 setImmediate(() => stream.emit('data', Uint8Array.from([1])));
104 const stream = source.map(async ([x]) => {
109 for await (const item of stream) {
117 const stream = Readable.from([1, 2, 3, 4, 5]).map(async (x) => {
119 stream.emit('error', new Error('boom'));
124 stream.map((x) => x + x).toArray(),
131 const stream = Readable.from([1, 2, 3, 4, 5]).map((x) => {
138 stream.map((x) => x + x).toArray(),
146 const stream = Readable.from([1, 2, 3, 4, 5]).map(async (x) => {
153 stream.map((x) => x + x).toArray(),
162 const stream = range.map(common.mustCall(async (_, { signal }) => {
168 for await (const item of stream) {
182 const stream = Readable.from([1, 2]).map(async (item, { signal }) => {
189 for await (const item of stream) {
203 const stream = raw.map(async (item) => {
213 await stream.toArray();
250 const stream = raw.map(async (item) => {
260 const outputOrder = await stream.toArray();
298 const stream = raw.map(async (item) => {
308 const outputOrder = await stream.toArray();
322 const stream = raw
340 await stream.toArray();
358 const stream = Readable.from([1, 2, 3, 4, 5]).map((x) => x);
359 assert.strictEqual(stream.readable, true);