-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Conversation
ping |
`cwd` allows you to specify the working directory from which the process is spawned. | ||
Use `env` to specify environment variables that will be visible to the new process. | ||
Use `cwd` to specify the working directory from which the process is spawned, | ||
the default is the current working diretory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/diretory/directory/g
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably split the two clauses -- "cwd
specifies the working directory of the process to be spawned. If not given, the default is the working directory of the parent process".
Great work! I feel that some parts may need a little clarification / modification; but I'm generally +1 on this change. |
Thanks for the comments, @chrisdickinson, I'll fix up and ping you. |
@chrisdickinson ping |
@@ -90,29 +90,71 @@ Messages send by `.send(message, [sendHandle])` are obtained using the | |||
* {Stream object} | |||
|
|||
A `Writable Stream` that represents the child process's `stdin`. | |||
Closing this stream via `end()` often causes the child process to terminate. | |||
If the child is waiting to read all it's input, it will not continue until this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/it's/its/g
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't like the "delete the entire line" option?
Thanks for bearing with me on this :) |
The example is not correct, and hasn't been since at least v0.10. Exec errors are emitted as an error event, and documented as such in the 'error' event section.
env was documented as not being process.env under some condtions, which is no longer correct.
Default was perhaps obvious, but not documented.
The lack of hyperlinks requires scrolling past pages of examples to find the options documentation, the default value of the 'stdio' option was not documented, and the documentation was not ordered readably.
Someone must have been confused by how pipes work, but this explanatory text is worse than nothing, it implies that ending stdin will cause child processes to terminate, which isn't true for the vast majority of them.
OK, I rebased, and removed the text describing some of the mechanisms child node processes can use to interact with their parent. Its not specific to child_process, its not clear to me if pipe even works on Windows for non-stdio, so I'm not the one to describe that feature, at least ATM. The rest of the PR doesn't depend on this paragraph. |
This looks great to me! Thanks very much. Going to leave this open till EOD (5PM PST) tomorrow for other folks to look at, and if there are no objections, I'll merge then. |
I looked at the changes a while ago. No comments. |
- Add hyperlinks from spawn options to subsections detailing what those options do. - Clarify some verbiage around ChildProcess.prototype.std{in,out,err}. - Remove second-person pronoun. PR-URL: #8639 Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
Merged in 3a08b7c. Thanks! |
@chrisdickinson thanks for your careful proof-reading. FWIW, |
@chrisdickinson Just to confirm, this will hit v0.12 eventually, right? My assumption is that PRs should be targetted at the oldest maintained branch they apply to, but I don't want this lost. |
- Add hyperlinks from spawn options to subsections detailing what those options do. - Clarify some verbiage around ChildProcess.prototype.std{in,out,err}. - Remove second-person pronoun. PR-URL: nodejs#8639 Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
- Add hyperlinks from spawn options to subsections detailing what those options do. - Clarify some verbiage around ChildProcess.prototype.std{in,out,err}. - Remove second-person pronoun. PR-URL: nodejs/node-v0.x-archive#8639 Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com> Cherry-picked-from: nodejs/node-v0.x-archive@3a08b7c3e0bc6757e70889196
Fix a number of outright errors in child process documentation, as well as improve the general readability of it by using hyperlinks, documenting defaults, ordering the docs consistently, etc.