From 8a98243fc63915f0b82902eb19e394b83386f99b Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 24 Dec 2019 15:09:29 -0800 Subject: [PATCH] doc,stream: use code markup/markdown in headers Backport-PR-URL: https://github.com/nodejs/node/pull/31108 PR-URL: https://github.com/nodejs/node/pull/31086 Reviewed-By: Anna Henningsen Reviewed-By: Ruben Bridgewater --- doc/api/stream.md | 136 +++++++++++++++++++++++----------------------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index e2a6accd90ad3f..08296d0f1e8341 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'` @@ -281,7 +281,7 @@ The stream is not closed when the `'error'` event is emitted unless the [`autoDestroy`][writable-new] option was set to `true` when creating the stream. -##### Event: 'finish' +##### Event: `'finish'` @@ -300,7 +300,7 @@ writer.on('finish', () => { }); ``` -##### Event: 'pipe' +##### Event: `'pipe'` @@ -320,7 +320,7 @@ writer.on('pipe', (src) => { reader.pipe(writer); ``` -##### Event: 'unpipe' +##### Event: `'unpipe'` @@ -346,7 +346,7 @@ reader.pipe(writer); reader.unpipe(writer); ``` -##### writable.cork() +##### `writable.cork()` @@ -363,7 +363,7 @@ buffered writes in a more optimized manner. See also: [`writable.uncork()`][]. -##### writable.destroy(\[error\]) +##### `writable.destroy([error])` @@ -382,7 +382,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` @@ -391,7 +391,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])` @@ -482,7 +482,7 @@ process.nextTick(() => { See also: [`writable.cork()`][]. -##### writable.writable +##### `writable.writable` @@ -491,7 +491,7 @@ added: v11.4.0 Is `true` if it is safe to call [`writable.write()`][stream-write]. -##### writable.writableEnded +##### `writable.writableEnded` @@ -502,7 +502,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.writableFinished +##### `writable.writableFinished` @@ -511,7 +511,7 @@ added: v12.6.0 Is set to `true` immediately before the [`'finish'`][] event is emitted. -##### writable.writableHighWaterMark +##### `writable.writableHighWaterMark` @@ -521,7 +521,7 @@ added: v9.3.0 Return the value of `highWaterMark` passed when constructing this `Writable`. -##### writable.writableLength +##### `writable.writableLength` @@ -532,7 +532,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` @@ -541,7 +541,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'` @@ -801,7 +801,7 @@ readable.on('data', (chunk) => { }); ``` -##### Event: 'end' +##### Event: `'end'` @@ -824,7 +824,7 @@ readable.on('end', () => { }); ``` -##### Event: 'error' +##### Event: `'error'` @@ -838,7 +838,7 @@ to push an invalid chunk of data. The listener callback will be passed a single `Error` object. -##### Event: 'pause' +##### Event: `'pause'` @@ -846,7 +846,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'` @@ -923,7 +923,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])` @@ -938,7 +938,7 @@ will be ignored. Implementors should not override this method, but instead implement [`readable._destroy()`][readable-_destroy]. -##### readable.destroyed +##### `readable.destroyed` @@ -947,7 +947,7 @@ added: v8.0.0 Is `true` after [`readable.destroy()`][readable-destroy] has been called. -##### readable.isPaused() +##### `readable.isPaused()` @@ -969,7 +969,7 @@ readable.resume(); readable.isPaused(); // === false ``` -##### readable.pause() +##### `readable.pause()` @@ -996,7 +996,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])` @@ -1058,7 +1058,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])` @@ -1110,7 +1110,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` @@ -1119,7 +1119,7 @@ added: v11.4.0 Is `true` if it is safe to call [`readable.read()`][stream-read]. -##### readable.readableEncoding +##### `readable.readableEncoding` @@ -1129,7 +1129,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` @@ -1138,7 +1138,7 @@ added: v12.9.0 Becomes `true` when [`'end'`][] event is emitted. -##### readable.readableFlowing +##### `readable.readableFlowing` @@ -1148,7 +1148,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` @@ -1158,7 +1158,7 @@ added: v9.3.0 Returns the value of `highWaterMark` passed when constructing this `Readable`. -##### readable.readableLength +##### `readable.readableLength` @@ -1169,7 +1169,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` @@ -1178,7 +1178,7 @@ added: v12.3.0 Getter for the property `objectMode` of a given `Readable` stream. -##### readable.resume() +##### `readable.resume()` @@ -1239,7 +1239,7 @@ readable.on('data', (chunk) => { }); ``` -##### readable.unpipe(\[destination\]) +##### `readable.unpipe([destination])` @@ -1270,7 +1270,7 @@ setTimeout(() => { }, 1000); ``` -##### readable.unshift(chunk\[, encoding\]) +##### `readable.unshift(chunk[, encoding])` @@ -1379,7 +1379,7 @@ myReader.on('readable', () => { }); ``` -##### readable\[Symbol.asyncIterator\]() +##### `readable[Symbol.asyncIterator]()` @@ -1451,7 +1451,7 @@ Examples of `Transform` streams include: * [zlib streams][zlib] * [crypto streams][crypto] -##### transform.destroy(\[error\]) +##### `transform.destroy([error])` @@ -1465,7 +1465,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)` @@ -1538,7 +1538,7 @@ const cleanup = finished(rs, (err) => { }); ``` -### stream.pipeline(...streams, callback) +### `stream.pipeline(...streams, callback)` @@ -1599,7 +1599,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])` @@ -1713,7 +1713,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])` @@ -1884,7 +1884,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)` @@ -1993,7 +1993,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])` @@ -2095,7 +2095,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)` @@ -2107,7 +2107,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])`