Skip to content
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,19 @@ file.end('world!');
// Writing more now is not allowed!
```

[`stream.end()`][stream-end] will call it's callback and emit `'error'`
Comment thread
ronag marked this conversation as resolved.
Outdated
with (in order of precedence):
* `ERR_STREAM_WRITE_AFTER_END` if `chunk` is not nully and
[`stream.end()`][stream-end] has been called.
Comment thread
ronag marked this conversation as resolved.
Outdated
* `ERR_STREAM_DESTROYED` if `chunk` is not nully and
[`stream.destroy()`][writable-destroy] has been called.
* `ERR_INVALID_ARG_TYPE` if `chunk` is not nully and
`chunk` is not a `string` when not in `objectMode`.
Comment thread
lundibundi marked this conversation as resolved.
Outdated
* `ERR_STREAM_ALREADY_FINISHED` if
[`writable.writableFinished`][] is `true`.
* Any error emitted by the instance through `'error'` before
Comment thread
ronag marked this conversation as resolved.
Outdated
[`writable.writableFinished`][] is set to `true`.

##### writable.setDefaultEncoding(encoding)
<!-- YAML
added: v0.11.15
Expand Down Expand Up @@ -619,6 +632,15 @@ write('hello', () => {

A `Writable` stream in object mode will always ignore the `encoding` argument.

`stream.write()` will call it's callback and emit `'error'`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`stream.write()` will call it's callback and emit `'error'`
`stream.write()` will call its callback and emit `'error'`

with (in order of precedence):
* `ERR_STREAM_WRITE_AFTER_END` if [`stream.end()`][stream-end] has been called.
* `ERR_STREAM_DESTROYED` if [`stream.destroy()`][writable-destroy] has been
called.
* `ERR_STREAM_NULL_VALUES` if `chunk` is `null`.
* `ERR_INVALID_ARG_TYPE` if `chunk` is not a `string` when not in `objectMode`.
* Any error forwarded by `writable._write()`.
Comment thread
ronag marked this conversation as resolved.
Outdated

### Readable Streams

Readable streams are an abstraction for a *source* from which data is
Expand Down