| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b022a14 commit cc425bc
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1075,16 +1075,16 @@ added: REPLACEME | |||
| 1075 | 1075 | Set this to match the reader's `chunkSize` for optimal `pipeTo()` | |
| 1076 | 1076 | performance. **Default:** `131072` (128 KB). | |
| 1077 | 1077 | * Returns: {Object} | |
| 1078 | - * `write(chunk[, options])` {Function} Returns {Promise\<void>}. | ||
| 1078 | + * `write(chunk[, options])` {Function} Returns {Promise}. | ||
| 1079 | 1079 | Accepts `Uint8Array`, `Buffer`, or string (UTF-8 encoded). | |
| 1080 | 1080 | * `chunk` {Buffer|TypedArray|DataView|string} | |
| 1081 | 1081 | * `options` {Object} | |
| 1082 | 1082 | * `signal` {AbortSignal} If the signal is already aborted, the write | |
| 1083 | 1083 | rejects with `AbortError` without performing I/O. | |
| 1084 | - * `writev(chunks[, options])` {Function} Returns {Promise\<void>}. Uses | ||
| 1084 | + * `writev(chunks[, options])` {Function} Returns {Promise}. Uses | ||
| 1085 | 1085 | scatter/gather I/O via a single `writev()` syscall. Accepts mixed | |
| 1086 | 1086 | `Uint8Array`/string arrays. | |
| 1087 | - * `chunks` {Array\<Buffer|TypedArray|DataView|string>} | ||
| 1087 | + * `chunks` {Buffer\[]|TypedArray\[]|DataView\[]|string\[]} | ||
| 1088 | 1088 | * `options` {Object} | |
| 1089 | 1089 | * `signal` {AbortSignal} If the signal is already aborted, the write | |
| 1090 | 1090 | rejects with `AbortError` without performing I/O. | |
@@ -1096,10 +1096,10 @@ added: REPLACEME | |||
| 1096 | 1096 | * `chunk` {Buffer|TypedArray|DataView|string} | |
| 1097 | 1097 | * `writevSync(chunks)` {Function} Returns {boolean}. Synchronous batch | |
| 1098 | 1098 | write. Same fallback semantics as `writeSync()`. | |
| 1099 | - * `chunks` {Array\<Buffer|TypedArray|DataView|string>} | ||
| 1100 | - * `end([options])` {Function} Returns {Promise\<number>} total bytes | ||
| 1101 | - written. Idempotent: returns `totalBytesWritten` if already closed, | ||
| 1102 | - returns the pending promise if already closing. Rejects if the writer | ||
| 1099 | + * `chunks` {Buffer\[]|TypedArray\[]|DataView\[]|string\[]} | ||
| 1100 | + * `end([options])` {Function} Returns {Promise}, fulfills with the total | ||
| 1101 | + number of bytes written. Idempotent: returns `totalBytesWritten` if already | ||
| 1102 | + closed, returns the pending promise if already closing. Rejects if the writer | ||
| 1103 | 1103 | is in an errored state. | |
| 1104 | 1104 | * `options` {Object} | |
| 1105 | 1105 | * `signal` {AbortSignal} If the signal is already aborted, `end()` | |
@@ -2882,7 +2882,7 @@ changes: | |||
| 2882 | 2882 | * `filter` {Function} Function to filter copied files/directories. Return | |
| 2883 | 2883 | `true` to copy the item, `false` to ignore it. When ignoring a directory, | |
| 2884 | 2884 | all of its contents will be skipped as well. Can also return a `Promise` | |
| 2885 | - that resolves to `true` or `false` **Default:** `undefined`. | ||
| 2885 | + that fulfills with `true` or `false`. **Default:** `undefined`. | ||
| 2886 | 2886 | * `src` {string} source path to copy. | |
| 2887 | 2887 | * `dest` {string} destination path to copy to. | |
| 2888 | 2888 | * Returns: {boolean|Promise} A value that is coercible to `boolean` or | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -220,7 +220,7 @@ that closes when the bucket is full: | |||
| 220 | 220 | ||
| 221 | 221 | * **Pending writes (the hose)** -- writes waiting for slot space. After | |
| 222 | 222 | the consumer drains, pending writes are promoted into the now-empty | |
| 223 | - slots and their promises resolve. | ||
| 223 | + slots and their promises settle. | ||
| 224 | 224 | ||
| 225 | 225 | How each policy uses these buffers: | |
| 226 | 226 | ||
@@ -430,7 +430,7 @@ The value is always non-negative. | |||
| 430 | 430 | * `options` {Object} | |
| 431 | 431 | * `signal` {AbortSignal} Cancel just this operation. The signal cancels only | |
| 432 | 432 | the pending `end()` call; it does not fail the writer itself. | |
| 433 | - * Returns: {Promise\<number>} Total bytes written. | ||
| 433 | + * Returns: {Promise} Fulfills with the total number of bytes written. | ||
| 434 | 434 | ||
| 435 | 435 | Signal that no more data will be written. | |
| 436 | 436 | ||
@@ -463,9 +463,9 @@ transition with no async work to perform. | |||
| 463 | 463 | * `options` {Object} | |
| 464 | 464 | * `signal` {AbortSignal} Cancel just this write operation. The signal cancels | |
| 465 | 465 | only the pending `write()` call; it does not fail the writer itself. | |
| 466 | - * Returns: {Promise\<void>} | ||
| 466 | + * Returns: {Promise} Fulfills with `undefined` when buffer space is available. | ||
| 467 | 467 | ||
| 468 | - Write a chunk. The promise resolves when buffer space is available. | ||
| 468 | + Write a chunk. | ||
| 469 | 469 | ||
| 470 | 470 | #### `writer.writeSync(chunk)` | |
| 471 | 471 | ||
@@ -481,7 +481,7 @@ Synchronous write. Does not block; returns `false` if backpressure is active. | |||
| 481 | 481 | * `options` {Object} | |
| 482 | 482 | * `signal` {AbortSignal} Cancel just this write operation. The signal cancels | |
| 483 | 483 | only the pending `writev()` call; it does not fail the writer itself. | |
| 484 | - * Returns: {Promise\<void>} | ||
| 484 | + * Returns: {Promise} | ||
| 485 | 485 | ||
| 486 | 486 | Write multiple chunks as a single batch. | |
| 487 | 487 | ||
@@ -603,7 +603,7 @@ added: REPLACEME | |||
| 603 | 603 | the source ends. **Default:** `false`. | |
| 604 | 604 | * `preventFail` {boolean} If `true`, do not call `writer.fail()` on | |
| 605 | 605 | error. **Default:** `false`. | |
| 606 | - * Returns: {Promise\<number>} Total bytes written. | ||
| 606 | + * Returns: {Promise} Fulfills with the total number of bytes written. | ||
| 607 | 607 | ||
| 608 | 608 | Pipe a source through transforms into a writer. If the writer has a | |
| 609 | 609 | `writev(chunks)` method, entire batches are passed in a single call (enabling | |
@@ -903,7 +903,7 @@ added: REPLACEME | |||
| 903 | 903 | * `signal` {AbortSignal} | |
| 904 | 904 | * `limit` {number} Maximum number of bytes to consume. If the total bytes | |
| 905 | 905 | collected exceeds limit, an `ERR_OUT_OF_RANGE` error is thrown | |
| 906 | - * Returns: {Promise\<Uint8Array\[]>} | ||
| 906 | + * Returns: {Promise} Fulfills with an array of `Uint8Array` objects. | ||
| 907 | 907 | ||
| 908 | 908 | Collect all chunks as an array of `Uint8Array` values (without concatenating). | |
| 909 | 909 | ||
@@ -918,7 +918,7 @@ added: REPLACEME | |||
| 918 | 918 | * `signal` {AbortSignal} | |
| 919 | 919 | * `limit` {number} Maximum number of bytes to consume. If the total bytes | |
| 920 | 920 | collected exceeds limit, an `ERR_OUT_OF_RANGE` error is thrown | |
| 921 | - * Returns: {Promise\<ArrayBuffer>} | ||
| 921 | + * Returns: {Promise} Fulfills with an `ArrayBuffer` object. | ||
| 922 | 922 | ||
| 923 | 923 | Collect all bytes into an `ArrayBuffer`. | |
| 924 | 924 | ||
@@ -961,7 +961,7 @@ added: REPLACEME | |||
| 961 | 961 | * `signal` {AbortSignal} | |
| 962 | 962 | * `limit` {number} Maximum number of bytes to consume. If the total bytes | |
| 963 | 963 | collected exceeds limit, an `ERR_OUT_OF_RANGE` error is thrown | |
| 964 | - * Returns: {Promise\<Uint8Array>} | ||
| 964 | + * Returns: {Promise} Fulfills with an `Uint8Array` object. | ||
| 965 | 965 | ||
| 966 | 966 | Collect all bytes from a stream into a single `Uint8Array`. | |
| 967 | 967 | ||
@@ -1009,7 +1009,7 @@ added: REPLACEME | |||
| 1009 | 1009 | * `signal` {AbortSignal} | |
| 1010 | 1010 | * `limit` {number} Maximum number of bytes to consume. If the total bytes | |
| 1011 | 1011 | collected exceeds limit, an `ERR_OUT_OF_RANGE` error is thrown | |
| 1012 | - * Returns: {Promise\<string>} | ||
| 1012 | + * Returns: {Promise} Fulfills with a `string`. | ||
| 1013 | 1013 | ||
| 1014 | 1014 | Collect all bytes and decode as text. | |
| 1015 | 1015 | ||
@@ -1053,11 +1053,11 @@ added: REPLACEME | |||
| 1053 | 1053 | --> | |
| 1054 | 1054 | ||
| 1055 | 1055 | * `drainable` {Object} An object implementing the drainable protocol. | |
| 1056 | - * Returns: {Promise\<boolean>|null} | ||
| 1056 | + * Returns: {Promise|null} | ||
| 1057 | 1057 | ||
| 1058 | - Wait for a drainable writer's backpressure to clear. Returns a promise that | ||
| 1059 | - resolves to `true` when the writer can accept more data, or `null` if the | ||
| 1060 | - object does not implement the drainable protocol. | ||
| 1058 | + Wait for a drainable writer's backpressure to clear. Returns `null` if | ||
| 1059 | + the object does not implement the drainable protocol, or a promise that | ||
| 1060 | + fulfills with `true` when the writer can accept more data. | ||
| 1061 | 1061 | ||
| 1062 | 1062 | ```mjs | |
| 1063 | 1063 | import { push, ondrain, text } from 'node:stream/iter'; | |
@@ -1768,8 +1768,8 @@ text(consumer).then(console.log); // 'hello' | |||
| 1768 | 1768 | * Value: `Symbol.for('Stream.drainableProtocol')` | |
| 1769 | 1769 | ||
| 1770 | 1770 | Implement to make a writer compatible with `ondrain()`. The method should | |
| 1771 | - return a promise that resolves when backpressure clears, or `null` if no | ||
| 1772 | - backpressure. | ||
| 1771 | + return `null` if no backpressure, or a promise that fulfills with a truthy value | ||
| 1772 | + when backpressure clears. | ||
| 1773 | 1773 | ||
| 1774 | 1774 | ```mjs | |
| 1775 | 1775 | import { ondrain } from 'node:stream/iter'; | |
@@ -1975,8 +1975,8 @@ console.log(textSync(consumer)); // 'hello' | |||
| 1975 | 1975 | The value must be a function that converts the object into a streamable value. | |
| 1976 | 1976 | When the object is encountered anywhere in the streaming pipeline (as a source | |
| 1977 | 1977 | passed to `from()`, or as a value returned from a transform), this method is | |
| 1978 | - called to produce the actual data. It may return (or resolve to) any streamable | ||
| 1979 | - value: a string, `Uint8Array`, `AsyncIterable`, `Iterable`, or another streamable | ||
| 1978 | + called to produce the actual data. It may return any value that resolves to: | ||
| 1979 | + a string, `Uint8Array`, `AsyncIterable`, `Iterable`, or another streamable | ||
| 1980 | 1980 | object. | |
| 1981 | 1981 | ||
| 1982 | 1982 | ```mjs | |
| Back | FazBrowse Home | New Git URL |
0 commit comments