diff --git a/doc/api/stream.md b/doc/api/stream.md index ad13e8ee6ade38..520572ea193991 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -206,14 +206,14 @@ myStream.write('some more data'); myStream.end('done writing data'); ``` -#### Class: stream.Writable +#### Class: `stream.Writable` -##### Event: 'close' +##### Event: `'close'` @@ -267,7 +267,7 @@ function writeOneMillionTimes(writer, data, encoding, callback) { } ``` -##### Event: 'error' +##### Event: `'error'` @@ -284,7 +284,7 @@ stream. After `'error'`, no further events other than `'close'` *should* be emitted (including `'error'` events). -##### Event: 'finish' +##### Event: `'finish'` @@ -303,7 +303,7 @@ writer.on('finish', () => { writer.end('This is the end\n'); ``` -##### Event: 'pipe' +##### Event: `'pipe'` @@ -323,7 +323,7 @@ writer.on('pipe', (src) => { reader.pipe(writer); ``` -##### Event: 'unpipe' +##### Event: `'unpipe'` @@ -349,7 +349,7 @@ reader.pipe(writer); reader.unpipe(writer); ``` -##### writable.cork() +##### `writable.cork()` @@ -366,7 +366,7 @@ buffered writes in a more optimized manner. See also: [`writable.uncork()`][]. -##### writable.destroy(\[error\]) +##### `writable.destroy([error])` @@ -385,7 +385,7 @@ the `'drain'` event before destroying the stream. Implementors should not override this method, but instead implement [`writable._destroy()`][writable-_destroy]. -##### writable.destroyed +##### `writable.destroyed` @@ -394,7 +394,7 @@ added: v8.0.0 Is `true` after [`writable.destroy()`][writable-destroy] has been called. -##### writable.end(\[chunk\[, encoding\]\]\[, callback\]) +##### `writable.end([chunk[, encoding]][, callback])` @@ -485,7 +485,7 @@ process.nextTick(() => { See also: [`writable.cork()`][]. -##### writable.writable +##### `writable.writable` @@ -494,7 +494,7 @@ added: v11.4.0 Is `true` if it is safe to call [`writable.write()`][stream-write]. -##### writable.writableEnded +##### `writable.writableEnded` @@ -505,7 +505,7 @@ Is `true` after [`writable.end()`][] has been called. This property does not indicate whether the data has been flushed, for this use [`writable.writableFinished`][] instead. -##### writable.writableCorked +##### `writable.writableCorked` @@ -515,7 +515,7 @@ added: v13.2.0 Number of times [`writable.uncork()`][stream-uncork] needs to be called in order to fully uncork the stream. -##### writable.writableFinished +##### `writable.writableFinished` @@ -524,7 +524,7 @@ added: v12.6.0 Is set to `true` immediately before the [`'finish'`][] event is emitted. -##### writable.writableHighWaterMark +##### `writable.writableHighWaterMark` @@ -534,7 +534,7 @@ added: v9.3.0 Return the value of `highWaterMark` passed when constructing this `Writable`. -##### writable.writableLength +##### `writable.writableLength` @@ -545,7 +545,7 @@ This property contains the number of bytes (or objects) in the queue ready to be written. The value provides introspection data regarding the status of the `highWaterMark`. -##### writable.writableObjectMode +##### `writable.writableObjectMode` @@ -554,7 +554,7 @@ added: v12.3.0 Getter for the property `objectMode` of a given `Writable` stream. -##### writable.write(chunk\[, encoding\]\[, callback\]) +##### `writable.write(chunk[, encoding][, callback])` -##### Event: 'close' +##### Event: `'close'` @@ -815,7 +815,7 @@ readable.on('data', (chunk) => { }); ``` -##### Event: 'end' +##### Event: `'end'` @@ -838,7 +838,7 @@ readable.on('end', () => { }); ``` -##### Event: 'error' +##### Event: `'error'` @@ -852,7 +852,7 @@ to push an invalid chunk of data. The listener callback will be passed a single `Error` object. -##### Event: 'pause' +##### Event: `'pause'` @@ -860,7 +860,7 @@ added: v0.9.4 The `'pause'` event is emitted when [`stream.pause()`][stream-pause] is called and `readableFlowing` is not `false`. -##### Event: 'readable' +##### Event: `'readable'` @@ -937,7 +937,7 @@ added: v0.9.4 The `'resume'` event is emitted when [`stream.resume()`][stream-resume] is called and `readableFlowing` is not `true`. -##### readable.destroy(\[error\]) +##### `readable.destroy([error])` @@ -952,7 +952,7 @@ will be ignored. Implementors should not override this method, but instead implement [`readable._destroy()`][readable-_destroy]. -##### readable.destroyed +##### `readable.destroyed` @@ -961,7 +961,7 @@ added: v8.0.0 Is `true` after [`readable.destroy()`][readable-destroy] has been called. -##### readable.isPaused() +##### `readable.isPaused()` @@ -983,7 +983,7 @@ readable.resume(); readable.isPaused(); // === false ``` -##### readable.pause() +##### `readable.pause()` @@ -1010,7 +1010,7 @@ readable.on('data', (chunk) => { The `readable.pause()` method has no effect if there is a `'readable'` event listener. -##### readable.pipe(destination\[, options\]) +##### `readable.pipe(destination[, options])` @@ -1072,7 +1072,7 @@ to prevent memory leaks. The [`process.stderr`][] and [`process.stdout`][] `Writable` streams are never closed until the Node.js process exits, regardless of the specified options. -##### readable.read(\[size\]) +##### `readable.read([size])` @@ -1124,7 +1124,7 @@ also be emitted. Calling [`stream.read([size])`][stream-read] after the [`'end'`][] event has been emitted will return `null`. No runtime error will be raised. -##### readable.readable +##### `readable.readable` @@ -1133,7 +1133,7 @@ added: v11.4.0 Is `true` if it is safe to call [`readable.read()`][stream-read]. -##### readable.readableEncoding +##### `readable.readableEncoding` @@ -1143,7 +1143,7 @@ added: v12.7.0 Getter for the property `encoding` of a given `Readable` stream. The `encoding` property can be set using the [`readable.setEncoding()`][] method. -##### readable.readableEnded +##### `readable.readableEnded` @@ -1152,7 +1152,7 @@ added: v12.9.0 Becomes `true` when [`'end'`][] event is emitted. -##### readable.readableFlowing +##### `readable.readableFlowing` @@ -1162,7 +1162,7 @@ added: v9.4.0 This property reflects the current state of a `Readable` stream as described in the [Stream Three States][] section. -##### readable.readableHighWaterMark +##### `readable.readableHighWaterMark` @@ -1172,7 +1172,7 @@ added: v9.3.0 Returns the value of `highWaterMark` passed when constructing this `Readable`. -##### readable.readableLength +##### `readable.readableLength` @@ -1183,7 +1183,7 @@ This property contains the number of bytes (or objects) in the queue ready to be read. The value provides introspection data regarding the status of the `highWaterMark`. -##### readable.readableObjectMode +##### `readable.readableObjectMode` @@ -1192,7 +1192,7 @@ added: v12.3.0 Getter for the property `objectMode` of a given `Readable` stream. -##### readable.resume() +##### `readable.resume()` @@ -1253,7 +1253,7 @@ readable.on('data', (chunk) => { }); ``` -##### readable.unpipe(\[destination\]) +##### `readable.unpipe([destination])` @@ -1284,7 +1284,7 @@ setTimeout(() => { }, 1000); ``` -##### readable.unshift(chunk\[, encoding\]) +##### `readable.unshift(chunk[, encoding])` @@ -1393,7 +1393,7 @@ myReader.on('readable', () => { }); ``` -##### readable\[Symbol.asyncIterator\]() +##### `readable[Symbol.asyncIterator]()` @@ -1465,7 +1465,7 @@ Examples of `Transform` streams include: * [zlib streams][zlib] * [crypto streams][crypto] -##### transform.destroy(\[error\]) +##### `transform.destroy([error])` @@ -1479,7 +1479,7 @@ Implementors should not override this method, but instead implement The default implementation of `_destroy()` for `Transform` also emit `'close'` unless `emitClose` is set in false. -### stream.finished(stream\[, options\], callback) +### `stream.finished(stream[, options], callback)` @@ -1552,7 +1552,7 @@ const cleanup = finished(rs, (err) => { }); ``` -### stream.pipeline(...streams, callback) +### `stream.pipeline(...streams, callback)` @@ -1613,7 +1613,7 @@ run().catch(console.error); after the `callback` has been invoked. In the case of reuse of streams after failure, this can cause event listener leaks and swallowed errors. -### stream.Readable.from(iterable, \[options\]) +### `stream.Readable.from(iterable, [options])` @@ -1731,7 +1731,7 @@ Custom `Writable` streams *must* call the `new stream.Writable([options])` constructor and implement the `writable._write()` and/or `writable._writev()` method. -#### Constructor: new stream.Writable(\[options\]) +#### Constructor: `new stream.Writable([options])` @@ -1902,7 +1902,7 @@ added: v8.0.0 The `_destroy()` method is called by [`writable.destroy()`][writable-destroy]. It can be overridden by child classes but it **must not** be called directly. -#### writable.\_final(callback) +#### `writable._final(callback)` @@ -2011,7 +2011,7 @@ The `stream.Readable` class is extended to implement a [`Readable`][] stream. Custom `Readable` streams *must* call the `new stream.Readable([options])` constructor and implement the `readable._read()` method. -#### new stream.Readable(\[options\]) +#### `new stream.Readable([options])` @@ -2113,7 +2113,7 @@ The `readable._read()` method is prefixed with an underscore because it is internal to the class that defines it, and should never be called directly by user programs. -#### readable.\_destroy(err, callback) +#### `readable._destroy(err, callback)` @@ -2125,7 +2125,7 @@ added: v8.0.0 The `_destroy()` method is called by [`readable.destroy()`][readable-destroy]. It can be overridden by child classes but it **must not** be called directly. -#### readable.push(chunk\[, encoding\]) +#### `readable.push(chunk[, encoding])`