readableStream.values([options])
添加于:v16.5.0
参数
options
<Object>preventCancel
<boolean>什么时候true
, 防止<ReadableStream>当异步迭代器突然终止时被关闭。默认值:false
创建并返回可用于使用此 ReadableStream
数据的异步迭代器。
当异步迭代器处于活动状态时,导致 readableStream.locked
为 true
。
import { Buffer } from 'node:buffer';
const stream = new ReadableStream(getSomeSource());
for await (const chunk of stream.values({ preventCancel: true }))
console.log(Buffer.from(chunk).toString());
相关用法
- Node.js ReadableStream.getReader([options])用法及代码示例
- Node.js ReadableStream.pipeThrough(transform[, options])用法及代码示例
- Node.js ReadableStreamBYOBReader用法及代码示例
- Node.js Readable Stream data事件用法及代码示例
- Node.js Readable Stream pause事件用法及代码示例
- Node.js Readable Stream readable事件用法及代码示例
- Node.js Readable Stream close事件用法及代码示例
- Node.js Readable Stream error事件用法及代码示例
- Node.js Readable Stream end事件用法及代码示例
- Node.js Readable Stream resume事件用法及代码示例
- Node.js ReferenceError用法及代码示例
- Node.js REPLServer.defineCommand(keyword, cmd)用法及代码示例
- Node.js RangeError用法及代码示例
- Node.js REPLServer用法及代码示例
- Node.js ServerHttp2Stream http2stream.pushStream(headers[, options], callback)用法及代码示例
- Node.js http2.Http2ServerRequest request.url用法及代码示例
- Node.js request.socket用法及代码示例
- Node.js assert.notEqual(actual, expected[, message])用法及代码示例
- Node.js tlsSocket.authorized用法及代码示例
- Node.js zlib.deflateRaw()用法及代码示例
- Node.js http.IncomingMessage message.rawHeaders用法及代码示例
- Node.js Console用法及代码示例
- Node.js GM transparent()用法及代码示例
- Node.js URL.protocol用法及代码示例
- Node.js http.Agent.reuseSocket(socket, request)用法及代码示例
注:本文由纯净天空筛选整理自nodejs.org大神的英文原创作品 ReadableStream.values([options])。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。