Browse Source

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>
v4.x
Mithun Patel 9 years ago
committed by Myles Borins
parent
commit
e572542de5
  1. 3
      doc/api/child_process.markdown
  2. 3
      doc/api/process.markdown

3
doc/api/child_process.markdown

@ -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

3
doc/api/process.markdown

@ -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
Loading…
Cancel
Save