mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
doc: Add note about use of JSON.stringify()
process.send and child.send use JSON.stringify to serialize the message. Fixes: https://github.com/nodejs/node/issues/5453 PR-URL: https://github.com/nodejs/node/pull/5723 Reviewed-By: Jeremy Whitlock <jwhitlock@apache.org> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
20539954ff
commit
e572542de5
2 files changed
+6
No files matched your search
@@ -884,6 +884,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}
|
||||
@@ -978,3 +980,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
|
||||
@@ -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)
|
||||
@@ -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
|
||||
Reference in new issue
Block a user