Skip to content

Commit

Permalink
fs: simplify create(Read|Write)Stream doc
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Sep 8, 2021
1 parent 08efc8f commit 4f9977a
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions doc/api/fs.md
Expand Up @@ -242,9 +242,9 @@ added: REPLACEME
* `start` {integer}
* `end` {integer} **Default:** `Infinity`
* `highWaterMark` {integer} **Default:** `64 * 1024`
* Returns: {fs.ReadStream} See [Readable Stream][].
* Returns: {fs.ReadStream}
Unlike the 16 kb default `highWaterMark` for a readable stream, the stream
Unlike the 16 kb default `highWaterMark` for a {stream.Readable}, the stream
returned by this method has a default `highWaterMark` of 64 kb.
`options` can include `start` and `end` values to read a range of bytes from
Expand All @@ -261,8 +261,7 @@ is available. This can prevent the process from exiting and the stream from
closing naturally.
By default, the stream will emit a `'close'` event after it has been
destroyed, like most `Readable` streams. Set the `emitClose` option to
`false` to change this behavior.
destroyed. Set the `emitClose` option to `false` to change this behavior.
```mjs
import { open } from 'fs/promises';
Expand Down Expand Up @@ -307,7 +306,7 @@ added: REPLACEME
* `autoClose` {boolean} **Default:** `true`
* `emitClose` {boolean} **Default:** `true`
* `start` {integer}
* Returns: {fs.WriteStream} See [Writable Stream][].
* Returns: {fs.WriteStream}
`options` may also include a `start` option to allow writing data at some
position past the beginning of the file, allowed values are in the
Expand All @@ -322,8 +321,7 @@ It is the application's responsibility to close it and make sure there's no
file descriptor leak.
By default, the stream will emit a `'close'` event after it has been
destroyed, like most `Writable` streams. Set the `emitClose` option to
`false` to change this behavior.
destroyed. Set the `emitClose` option to `false` to change this behavior.
#### `filehandle.datasync()`
<!-- YAML
Expand Down Expand Up @@ -2072,9 +2070,9 @@ changes:
* `end` {integer} **Default:** `Infinity`
* `highWaterMark` {integer} **Default:** `64 * 1024`
* `fs` {Object|null} **Default:** `null`
* Returns: {fs.ReadStream} See [Readable Stream][].
* Returns: {fs.ReadStream}
Unlike the 16 kb default `highWaterMark` for a readable stream, the stream
Unlike the 16 kb default `highWaterMark` for a {stream.Readable}, the stream
returned by this method has a default `highWaterMark` of 64 kb.
`options` can include `start` and `end` values to read a range of bytes from
Expand All @@ -2096,8 +2094,7 @@ available. This can prevent the process from exiting and the stream from
closing naturally.
By default, the stream will emit a `'close'` event after it has been
destroyed, like most `Readable` streams. Set the `emitClose` option to
`false` to change this behavior.
destroyed. Set the `emitClose` option to `false` to change this behavior.
By providing the `fs` option, it is possible to override the corresponding `fs`
implementations for `open`, `read`, and `close`. When providing the `fs` option,
Expand Down Expand Up @@ -2185,7 +2182,7 @@ changes:
* `emitClose` {boolean} **Default:** `true`
* `start` {integer}
* `fs` {Object|null} **Default:** `null`
* Returns: {fs.WriteStream} See [Writable Stream][].
* Returns: {fs.WriteStream}
`options` may also include a `start` option to allow writing data at some
position past the beginning of the file, allowed values are in the
Expand All @@ -2200,8 +2197,7 @@ It is the application's responsibility to close it and make sure there's no
file descriptor leak.
By default, the stream will emit a `'close'` event after it has been
destroyed, like most `Writable` streams. Set the `emitClose` option to
`false` to change this behavior.
destroyed. Set the `emitClose` option to `false` to change this behavior.
By providing the `fs` option it is possible to override the corresponding `fs`
implementations for `open`, `write`, `writev` and `close`. Overriding `write()`
Expand Down

0 comments on commit 4f9977a

Please sign in to comment.