Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add note that process.send and child.send use JSON.stringify() #5723

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions doc/api/child_process.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,8 @@ tracking when the socket is destroyed. To indicate this, the `.connections`
property becomes `null`. It is recommended not to use `.maxConnections` when
this occurs.

*Note: this function uses [`JSON.stringify()`][] internally to serialize the `message`.*

### child.stderr

* {Stream}
Expand Down Expand Up @@ -996,3 +998,4 @@ to the same value.
[`options.stdio`]: #child_process_options_stdio
[`stdio`]: #child_process_options_stdio
[synchronous counterparts]: #child_process_synchronous_process_creation
[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify
3 changes: 3 additions & 0 deletions doc/api/process.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,8 @@ When Node.js is spawned with an IPC channel attached, it can send messages to it
parent process using `process.send()`. Each will be received as a
[`'message'`][] event on the parent's `ChildProcess` object.

*Note: this function uses [`JSON.stringify()`][] internally to serialize the `message`.*

If Node.js was not spawned with an IPC channel, `process.send()` will be undefined.

## process.setegid(id)
Expand Down Expand Up @@ -1096,3 +1098,4 @@ Will print something like:
[Signal Events]: #process_signal_events
[Stream compatibility]: stream.html#stream_compatibility_with_older_node_js_versions
[the tty docs]: tty.html#tty_tty
[`JSON.stringify()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify