Commit fe5461ca authored by Jérémy Lal's avatar Jérémy Lal

Imported Upstream version 5.5.0~dfsg

parent 227790a3
lib/internal/v8_prof_polyfill.js lib/internal/v8_prof_polyfill.js
lib/internal/v8_prof_processor.js lib/internal/v8_prof_processor.js
lib/punycode.js lib/punycode.js
test/addons/doc-*/ test/addons/??_*/
test/fixtures test/fixtures
test/**/node_modules test/**/node_modules
test/disabled test/disabled
......
...@@ -25,10 +25,10 @@ rules: ...@@ -25,10 +25,10 @@ rules:
no-dupe-keys: 2 no-dupe-keys: 2
## check duplicate switch-case ## check duplicate switch-case
no-duplicate-case: 2 no-duplicate-case: 2
## disallow superfluous semicolons
no-extra-semi: 2
## disallow assignment of exceptional params ## disallow assignment of exceptional params
no-ex-assign: 2 no-ex-assign: 2
## disallow use of reserved words as keys like enum, class
no-reserved-keys: 2
## disallow unreachable code ## disallow unreachable code
no-unreachable: 2 no-unreachable: 2
## require valid typeof compared string like typeof foo === 'strnig' ## require valid typeof compared string like typeof foo === 'strnig'
...@@ -44,7 +44,7 @@ rules: ...@@ -44,7 +44,7 @@ rules:
## use single quote, we can use double quote when escape chars ## use single quote, we can use double quote when escape chars
quotes: [2, "single", "avoid-escape"] quotes: [2, "single", "avoid-escape"]
## 2 space indentation ## 2 space indentation
indent: [2, 2] indent: [2, 2, {SwitchCase: 1}]
## add space after comma ## add space after comma
comma-spacing: 2 comma-spacing: 2
## put semi-colon ## put semi-colon
...@@ -67,8 +67,10 @@ rules: ...@@ -67,8 +67,10 @@ rules:
eol-last: 2 eol-last: 2
## no trailing spaces ## no trailing spaces
no-trailing-spaces: 2 no-trailing-spaces: 2
# require space after keywords, eg 'for (..)' ## require space after keywords, eg 'for (..)'
space-after-keywords: 2 space-after-keywords: 2
## no leading/trailing spaces in parens
space-in-parens: [2, "never"]
# ECMAScript 6 # ECMAScript 6
# list: http://eslint.org/docs/rules/#ecmascript-6 # list: http://eslint.org/docs/rules/#ecmascript-6
...@@ -112,5 +114,3 @@ globals: ...@@ -112,5 +114,3 @@ globals:
DTRACE_NET_SERVER_CONNECTION : false DTRACE_NET_SERVER_CONNECTION : false
LTTNG_NET_SERVER_CONNECTION : false LTTNG_NET_SERVER_CONNECTION : false
COUNTER_NET_SERVER_CONNECTION : false COUNTER_NET_SERVER_CONNECTION : false
escape : false
unescape : false
...@@ -24,7 +24,7 @@ icu_config.gypi ...@@ -24,7 +24,7 @@ icu_config.gypi
# various stuff that VC++ produces/uses # various stuff that VC++ produces/uses
Debug/ Debug/
!deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug !**/node_modules/debug/
!deps/v8/src/debug/ !deps/v8/src/debug/
Release/ Release/
!doc/blog/** !doc/blog/**
...@@ -51,7 +51,7 @@ ipch/ ...@@ -51,7 +51,7 @@ ipch/
/npm.wxs /npm.wxs
/tools/msvs/npm.wixobj /tools/msvs/npm.wixobj
/tools/osx-pkg.pmdoc/index.xml /tools/osx-pkg.pmdoc/index.xml
/test/addons/doc-*/ /test/addons/??_*/
email.md email.md
deps/v8-* deps/v8-*
deps/icu deps/icu
......
This diff is collapsed.
This diff is collapsed.
...@@ -105,12 +105,12 @@ test/gc/node_modules/weak/build/Release/weakref.node: $(NODE_EXE) ...@@ -105,12 +105,12 @@ test/gc/node_modules/weak/build/Release/weakref.node: $(NODE_EXE)
# Implicitly depends on $(NODE_EXE), see the build-addons rule for rationale. # Implicitly depends on $(NODE_EXE), see the build-addons rule for rationale.
test/addons/.docbuildstamp: doc/api/addons.markdown test/addons/.docbuildstamp: doc/api/addons.markdown
$(RM) -r test/addons/doc-*/ $(RM) -r test/addons/??_*/
$(NODE) tools/doc/addon-verify.js $(NODE) tools/doc/addon-verify.js
touch $@ touch $@
ADDONS_BINDING_GYPS := \ ADDONS_BINDING_GYPS := \
$(filter-out test/addons/doc-*/binding.gyp, \ $(filter-out test/addons/??_*/binding.gyp, \
$(wildcard test/addons/*/binding.gyp)) $(wildcard test/addons/*/binding.gyp))
# Implicitly depends on $(NODE_EXE), see the build-addons rule for rationale. # Implicitly depends on $(NODE_EXE), see the build-addons rule for rationale.
...@@ -510,7 +510,7 @@ bench-idle: ...@@ -510,7 +510,7 @@ bench-idle:
jslint: jslint:
$(NODE) tools/eslint/bin/eslint.js src lib test tools/eslint-rules \ $(NODE) tools/eslint/bin/eslint.js src lib test tools/eslint-rules \
--rulesdir tools/eslint-rules --reset --quiet --rulesdir tools/eslint-rules --quiet
CPPLINT_EXCLUDE ?= CPPLINT_EXCLUDE ?=
CPPLINT_EXCLUDE += src/node_lttng.cc CPPLINT_EXCLUDE += src/node_lttng.cc
...@@ -520,7 +520,7 @@ CPPLINT_EXCLUDE += src/node_win32_perfctr_provider.cc ...@@ -520,7 +520,7 @@ CPPLINT_EXCLUDE += src/node_win32_perfctr_provider.cc
CPPLINT_EXCLUDE += src/queue.h CPPLINT_EXCLUDE += src/queue.h
CPPLINT_EXCLUDE += src/tree.h CPPLINT_EXCLUDE += src/tree.h
CPPLINT_EXCLUDE += src/v8abbr.h CPPLINT_EXCLUDE += src/v8abbr.h
CPPLINT_EXCLUDE += $(wildcard test/addons/doc-*/*.cc test/addons/doc-*/*.h) CPPLINT_EXCLUDE += $(wildcard test/addons/??_*/*.cc test/addons/??_*/*.h)
CPPLINT_FILES = $(filter-out $(CPPLINT_EXCLUDE), $(wildcard \ CPPLINT_FILES = $(filter-out $(CPPLINT_EXCLUDE), $(wildcard \
deps/debugger-agent/include/* \ deps/debugger-agent/include/* \
......
...@@ -444,7 +444,7 @@ Releases of Node.js and io.js will be signed with one of the following GPG keys: ...@@ -444,7 +444,7 @@ Releases of Node.js and io.js will be signed with one of the following GPG keys:
* **Jeremiah Senkpiel** <fishrock@keybase.io> `FD3A5288F042B6850C66B31F09FE44734EB7990E` * **Jeremiah Senkpiel** <fishrock@keybase.io> `FD3A5288F042B6850C66B31F09FE44734EB7990E`
* **James M Snell** <jasnell@keybase.io> `71DCFD284A79C3B38668286BC97EC7A07EDE3FC1` * **James M Snell** <jasnell@keybase.io> `71DCFD284A79C3B38668286BC97EC7A07EDE3FC1`
* **Rod Vagg** <rod@vagg.org> `DD8F2338BAE7501E3DD5AC78C273792F7D83545D` * **Rod Vagg** <rod@vagg.org> `DD8F2338BAE7501E3DD5AC78C273792F7D83545D`
* **Myles Borins** <thealphanerd@keybase.io> `792807C150954BF0299B289A38CE40DEEE898E15` * **Myles Borins** <myles.borins@gmail.com> `C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8`
* **Evan Lucas** <evanlucas@me.com> `B9AE9905FFD7803F25714661B63B535A4C206CA9` * **Evan Lucas** <evanlucas@me.com> `B9AE9905FFD7803F25714661B63B535A4C206CA9`
The full set of trusted release keys can be imported by running: The full set of trusted release keys can be imported by running:
...@@ -456,7 +456,7 @@ gpg --keyserver pool.sks-keyservers.net --recv-keys 0034A06D9D9B0064CE8ADF6BF174 ...@@ -456,7 +456,7 @@ gpg --keyserver pool.sks-keyservers.net --recv-keys 0034A06D9D9B0064CE8ADF6BF174
gpg --keyserver pool.sks-keyservers.net --recv-keys FD3A5288F042B6850C66B31F09FE44734EB7990E gpg --keyserver pool.sks-keyservers.net --recv-keys FD3A5288F042B6850C66B31F09FE44734EB7990E
gpg --keyserver pool.sks-keyservers.net --recv-keys 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 gpg --keyserver pool.sks-keyservers.net --recv-keys 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1
gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D
gpg --keyserver pool.sks-keyservers.net --recv-keys 792807C150954BF0299B289A38CE40DEEE898E15 gpg --keyserver pool.sks-keyservers.net --recv-keys C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8
gpg --keyserver pool.sks-keyservers.net --recv-keys B9AE9905FFD7803F25714661B63B535A4C206CA9 gpg --keyserver pool.sks-keyservers.net --recv-keys B9AE9905FFD7803F25714661B63B535A4C206CA9
``` ```
......
...@@ -3,7 +3,7 @@ var querystring = require('querystring'); ...@@ -3,7 +3,7 @@ var querystring = require('querystring');
var v8 = require('v8'); var v8 = require('v8');
var bench = common.createBenchmark(main, { var bench = common.createBenchmark(main, {
type: ['noencode', 'encodemany', 'encodelast'], type: ['noencode', 'encodemany', 'encodelast', 'multivalue'],
n: [1e6], n: [1e6],
}); });
...@@ -14,7 +14,8 @@ function main(conf) { ...@@ -14,7 +14,8 @@ function main(conf) {
var inputs = { var inputs = {
noencode: 'foo=bar&baz=quux&xyzzy=thud', noencode: 'foo=bar&baz=quux&xyzzy=thud',
encodemany: '%66%6F%6F=bar&%62%61%7A=quux&xyzzy=%74h%75d', encodemany: '%66%6F%6F=bar&%62%61%7A=quux&xyzzy=%74h%75d',
encodelast: 'foo=bar&baz=quux&xyzzy=thu%64' encodelast: 'foo=bar&baz=quux&xyzzy=thu%64',
multivalue: 'foo=bar&foo=baz&foo=quux&quuy=quuz'
}; };
var input = inputs[type]; var input = inputs[type];
......
...@@ -95,9 +95,9 @@ parser.add_option("--partly-static", ...@@ -95,9 +95,9 @@ parser.add_option("--partly-static",
parser.add_option("--enable-vtune-profiling", parser.add_option("--enable-vtune-profiling",
action="store_true", action="store_true",
dest="enable_vtune_profiling", dest="enable_vtune_profiling",
help="Enable profiling support for Intel Vtune profiler to profile" help="Enable profiling support for Intel VTune profiler to profile"
"JavaScript code executed in nodejs. This feature is only available " "JavaScript code executed in nodejs. This feature is only available "
"for ia32, x32 or x64 platform.") "for x32, x86 and x64 architectures.")
parser.add_option("--link-module", parser.add_option("--link-module",
...@@ -692,8 +692,8 @@ def configure_node(o): ...@@ -692,8 +692,8 @@ def configure_node(o):
o['variables']['node_enable_v8_vtunejit'] = b(options.enable_vtune_profiling) o['variables']['node_enable_v8_vtunejit'] = b(options.enable_vtune_profiling)
elif options.enable_vtune_profiling: elif options.enable_vtune_profiling:
raise Exception( raise Exception(
'vtune profiler for JavaScript is only supported on x86, x32 or x64 ' 'The VTune profiler for JavaScript is only supported on x32, x86 and x64 '
'platform.') 'architectures.')
else: else:
o['variables']['node_enable_v8_vtunejit'] = 'false' o['variables']['node_enable_v8_vtunejit'] = 'false'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title> Node.js v5.4.1 Manual &amp; Documentation</title> <title> Node.js v5.5.0 Manual &amp; Documentation</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic">
<link rel="stylesheet" href="assets/style.css"> <link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css"> <link rel="stylesheet" href="assets/sh.css">
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<div id="column1" data-id="_toc" class="interior"> <div id="column1" data-id="_toc" class="interior">
<header> <header>
<h1>Node.js v5.4.1 Documentation</h1> <h1>Node.js v5.5.0 Documentation</h1>
<div id="gtoc"> <div id="gtoc">
<p> <p>
<a href="index.html" name="toc">Index</a> | <a href="index.html" name="toc">Index</a> |
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Addons Node.js v5.4.1 Manual &amp; Documentation</title> <title>Addons Node.js v5.5.0 Manual &amp; Documentation</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic">
<link rel="stylesheet" href="assets/style.css"> <link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css"> <link rel="stylesheet" href="assets/sh.css">
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<div id="column1" data-id="addons" class="interior"> <div id="column1" data-id="addons" class="interior">
<header> <header>
<h1>Node.js v5.4.1 Documentation</h1> <h1>Node.js v5.5.0 Documentation</h1>
<div id="gtoc"> <div id="gtoc">
<p> <p>
<a href="index.html" name="toc">Index</a> | <a href="index.html" name="toc">Index</a> |
...@@ -142,7 +142,7 @@ that Addons can use &mdash; the most important of which is the ...@@ -142,7 +142,7 @@ that Addons can use &mdash; the most important of which is the
OpenSSL. These other libraries are located in the <code>deps/</code> directory in the OpenSSL. These other libraries are located in the <code>deps/</code> directory in the
Node.js source tree. Only the V8 and OpenSSL symbols are purposefully Node.js source tree. Only the V8 and OpenSSL symbols are purposefully
re-exported by Node.js and may be used to various extents by Addons. re-exported by Node.js and may be used to various extents by Addons.
See <a href="#linking-to-node-js-own-dependencies">Linking to Node.js&#39; own dependencies</a> for additional information.</p> See <a href="#linking-to-nodejs-own-dependencies">Linking to Node.js&#39; own dependencies</a> for additional information.</p>
</li> </li>
</ul> </ul>
<p>All of the following examples are available for <a href="https://github.com/nodejs/node-addon-examples">download</a> and may <p>All of the following examples are available for <a href="https://github.com/nodejs/node-addon-examples">download</a> and may
......
...@@ -1018,5 +1018,5 @@ Test in JavaScript by running: ...@@ -1018,5 +1018,5 @@ Test in JavaScript by running:
[Native Abstrations for Node.js]: https://github.com/nodejs/nan [Native Abstrations for Node.js]: https://github.com/nodejs/nan
[examples]: https://github.com/nodejs/nan/tree/master/examples/ [examples]: https://github.com/nodejs/nan/tree/master/examples/
[bindings]: https://github.com/TooTallNate/node-bindings [bindings]: https://github.com/TooTallNate/node-bindings
[Linking to Node.js' own dependencies]: #linking-to-node-js-own-dependencies [Linking to Node.js' own dependencies]: #linking-to-nodejs-own-dependencies
[installation instructions]: https://github.com/nodejs/node-gyp#installation [installation instructions]: https://github.com/nodejs/node-gyp#installation
This diff is collapsed.
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Assert Node.js v5.4.1 Manual &amp; Documentation</title> <title>Assert Node.js v5.5.0 Manual &amp; Documentation</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic">
<link rel="stylesheet" href="assets/style.css"> <link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css"> <link rel="stylesheet" href="assets/sh.css">
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<div id="column1" data-id="assert" class="interior"> <div id="column1" data-id="assert" class="interior">
<header> <header>
<h1>Node.js v5.4.1 Documentation</h1> <h1>Node.js v5.5.0 Documentation</h1>
<div id="gtoc"> <div id="gtoc">
<p> <p>
<a href="index.html" name="toc">Index</a> | <a href="index.html" name="toc">Index</a> |
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Buffer Node.js v5.4.1 Manual &amp; Documentation</title> <title>Buffer Node.js v5.5.0 Manual &amp; Documentation</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic">
<link rel="stylesheet" href="assets/style.css"> <link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css"> <link rel="stylesheet" href="assets/sh.css">
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<div id="column1" data-id="buffer" class="interior"> <div id="column1" data-id="buffer" class="interior">
<header> <header>
<h1>Node.js v5.4.1 Documentation</h1> <h1>Node.js v5.5.0 Documentation</h1>
<div id="gtoc"> <div id="gtoc">
<p> <p>
<a href="index.html" name="toc">Index</a> | <a href="index.html" name="toc">Index</a> |
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Child Process Node.js v5.4.1 Manual &amp; Documentation</title> <title>Child Process Node.js v5.5.0 Manual &amp; Documentation</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic">
<link rel="stylesheet" href="assets/style.css"> <link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css"> <link rel="stylesheet" href="assets/sh.css">
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<div id="column1" data-id="child_process" class="interior"> <div id="column1" data-id="child_process" class="interior">
<header> <header>
<h1>Node.js v5.4.1 Documentation</h1> <h1>Node.js v5.5.0 Documentation</h1>
<div id="gtoc"> <div id="gtoc">
<p> <p>
<a href="index.html" name="toc">Index</a> | <a href="index.html" name="toc">Index</a> |
...@@ -186,8 +186,8 @@ and <code>child_process.execFile()</code> methods all follow the idiomatic async ...@@ -186,8 +186,8 @@ and <code>child_process.execFile()</code> methods all follow the idiomatic async
programming pattern typical of other Node.js APIs. programming pattern typical of other Node.js APIs.
</p> </p>
<p>Each of the methods returns a [ChildProcess][] instance. These objects <p>Each of the methods returns a <a href="#child_process_child_process"><code>ChildProcess</code></a> instance. These objects
implement the Node.js [EventEmitter][] API, allowing the parent process to implement the Node.js <a href="events.html#events_class_events_eventemitter"><code>EventEmitter</code></a> API, allowing the parent process to
register listener functions that are called when certain events occur during register listener functions that are called when certain events occur during
the life cycle of the child process. the life cycle of the child process.
...@@ -310,7 +310,7 @@ replace the existing process and uses a shell to execute the command.</em> ...@@ -310,7 +310,7 @@ replace the existing process and uses a shell to execute the command.</em>
</p> </p>
<h3>child_process.execFile(file[, args][, options][, callback])<span><a class="mark" href="#child_process_child_process_execfile_file_args_options_callback" id="child_process_child_process_execfile_file_args_options_callback">#</a></span></h3> <h3>child_process.execFile(file[, args][, options][, callback])<span><a class="mark" href="#child_process_child_process_execfile_file_args_options_callback" id="child_process_child_process_execfile_file_args_options_callback">#</a></span></h3>
<div class="signature"><ul> <div class="signature"><ul>
<li><code>file</code> <span class="type">String</span> The filename of the program to run</li> <li><code>file</code> <span class="type">String</span> A path to an executable file</li>
<li><code>args</code> <span class="type">Array</span> List of string arguments</li> <li><code>args</code> <span class="type">Array</span> List of string arguments</li>
<li><code>options</code> <span class="type">Object</span><ul> <li><code>options</code> <span class="type">Object</span><ul>
<li><code>cwd</code> <span class="type">String</span> Current working directory of the child process</li> <li><code>cwd</code> <span class="type">String</span> Current working directory of the child process</li>
...@@ -332,21 +332,22 @@ stderr - if exceeded child process is killed (Default: 200*1024)</li> ...@@ -332,21 +332,22 @@ stderr - if exceeded child process is killed (Default: 200*1024)</li>
</li> </li>
<li>Return: ChildProcess object</li> <li>Return: ChildProcess object</li>
</div></ul> </div></ul>
<p>The <code>child_process.execFile()</code> method is similar to <a href="#child_process_child_process_exec_command_options_callback"><code>child_process.exec()</code></a> <p>The <code>child_process.execFile()</code> function is similar to <a href="#child_process_child_process_exec_command_options_callback"><code>child_process.exec()</code></a>
except that it does not first spawn a shell. Rather, the specified <code>command</code> is except that it does not spawn a shell. Rather, the specified executable <code>file</code>
spawned directly as a new process making it slightly more efficient than is spawned directly as a new process making it slightly more efficient than
<a href="#child_process_child_process_exec_command_options_callback"><code>child_process.exec()</code></a>. The same options are support by both <a href="#child_process_child_process_exec_command_options_callback"><code>child_process.exec()</code></a>.
<code>child_process.exec()</code> and <code>child_process.execFile()</code>.
</p> </p>
<pre><code>const exec = require(&#39;child_process&#39;).execFile; <p>The same options as <code>child_process.exec()</code> are supported. Since a shell is not
const child = execFile(&#39;cat *.js bad_file | wc -l&#39;, spawned, behaviors such as I/O redirection and file globbing are not supported.
(error, stdout, stderr) =&gt; {
console.log(`stdout: ${stdout}`); </p>
console.log(`stderr: ${stderr}`); <pre><code>const execFile = require(&#39;child_process&#39;).execFile;
if (error !== null) { const child = execFile(&#39;node&#39;, [&#39;--version&#39;], (error, stdout, stderr) =&gt; {
console.log(`exec error: ${error}`); if (error) {
} throw error;
}
console.log(stdout);
});</code></pre> });</code></pre>
<h3>child_process.fork(modulePath[, args][, options])<span><a class="mark" href="#child_process_child_process_fork_modulepath_args_options" id="child_process_child_process_fork_modulepath_args_options">#</a></span></h3> <h3>child_process.fork(modulePath[, args][, options])<span><a class="mark" href="#child_process_child_process_fork_modulepath_args_options" id="child_process_child_process_fork_modulepath_args_options">#</a></span></h3>
<div class="signature"><ul> <div class="signature"><ul>
...@@ -360,9 +361,8 @@ const child = execFile(&#39;cat *.js bad_file | wc -l&#39;, ...@@ -360,9 +361,8 @@ const child = execFile(&#39;cat *.js bad_file | wc -l&#39;,
(Default: <code>process.execArgv</code>)</li> (Default: <code>process.execArgv</code>)</li>
<li><code>silent</code> <span class="type">Boolean</span> If true, stdin, stdout, and stderr of the child will be <li><code>silent</code> <span class="type">Boolean</span> If true, stdin, stdout, and stderr of the child will be
piped to the parent, otherwise they will be inherited from the parent, see piped to the parent, otherwise they will be inherited from the parent, see
the <code>&#39;pipe&#39;</code> and <code>&#39;inherit&#39;</code> options for [<code>spawn()</code>][]&#39;s <a href="#child_process_options_stdio"><code>stdio</code></a> for the <code>&#39;pipe&#39;</code> and <code>&#39;inherit&#39;</code> options for <a href="#child_process_child_process_spawn_command_args_options"><code>child_process.spawn()</code></a>&#39;s
more details <a href="#child_process_options_stdio"><code>stdio</code></a> for more details (default is false)</li>
(default is false)</li>
<li><code>uid</code> <span class="type">Number</span> Sets the user identity of the process. (See setuid(2).)</li> <li><code>uid</code> <span class="type">Number</span> Sets the user identity of the process. (See setuid(2).)</li>
<li><code>gid</code> <span class="type">Number</span> Sets the group identity of the process. (See setgid(2).)</li> <li><code>gid</code> <span class="type">Number</span> Sets the group identity of the process. (See setgid(2).)</li>
</ul> </ul>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
{ {
"textRaw": "Asynchronous Process Creation", "textRaw": "Asynchronous Process Creation",
"name": "asynchronous_process_creation", "name": "asynchronous_process_creation",
"desc": "<p>The <code>child_process.spawn()</code>, <code>child_process.fork()</code>, <code>child_process.exec()</code>,\nand <code>child_process.execFile()</code> methods all follow the idiomatic asynchronous\nprogramming pattern typical of other Node.js APIs.\n\n</p>\n<p>Each of the methods returns a [ChildProcess][] instance. These objects\nimplement the Node.js [EventEmitter][] API, allowing the parent process to\nregister listener functions that are called when certain events occur during\nthe life cycle of the child process.\n\n</p>\n<p>The <code>child_process.exec()</code> and <code>child_process.execFile()</code> methods additionally\nallow for an optional <code>callback</code> function to be specified that is invoked\nwhen the child process terminates.\n\n</p>\n", "desc": "<p>The <code>child_process.spawn()</code>, <code>child_process.fork()</code>, <code>child_process.exec()</code>,\nand <code>child_process.execFile()</code> methods all follow the idiomatic asynchronous\nprogramming pattern typical of other Node.js APIs.\n\n</p>\n<p>Each of the methods returns a [<code>ChildProcess</code>][] instance. These objects\nimplement the Node.js [<code>EventEmitter</code>][] API, allowing the parent process to\nregister listener functions that are called when certain events occur during\nthe life cycle of the child process.\n\n</p>\n<p>The <code>child_process.exec()</code> and <code>child_process.execFile()</code> methods additionally\nallow for an optional <code>callback</code> function to be specified that is invoked\nwhen the child process terminates.\n\n</p>\n",
"modules": [ "modules": [
{ {
"textRaw": "Spawning `.bat` and `.cmd` files on Windows", "textRaw": "Spawning `.bat` and `.cmd` files on Windows",
...@@ -160,10 +160,10 @@ ...@@ -160,10 +160,10 @@
}, },
"params": [ "params": [
{ {
"textRaw": "`file` {String} The filename of the program to run ", "textRaw": "`file` {String} A path to an executable file ",
"name": "file", "name": "file",
"type": "String", "type": "String",
"desc": "The filename of the program to run" "desc": "A path to an executable file"
}, },
{ {
"textRaw": "`args` {Array} List of string arguments ", "textRaw": "`args` {Array} List of string arguments ",
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
] ]
} }
], ],
"desc": "<p>The <code>child_process.execFile()</code> method is similar to [<code>child_process.exec()</code>][]\nexcept that it does not first spawn a shell. Rather, the specified <code>command</code> is\nspawned directly as a new process making it slightly more efficient than\n[<code>child_process.exec()</code>][]. The same options are support by both\n<code>child_process.exec()</code> and <code>child_process.execFile()</code>.\n\n</p>\n<pre><code>const exec = require(&#39;child_process&#39;).execFile;\nconst child = execFile(&#39;cat *.js bad_file | wc -l&#39;,\n (error, stdout, stderr) =&gt; {\n console.log(`stdout: ${stdout}`);\n console.log(`stderr: ${stderr}`);\n if (error !== null) {\n console.log(`exec error: ${error}`);\n }\n});</code></pre>\n" "desc": "<p>The <code>child_process.execFile()</code> function is similar to [<code>child_process.exec()</code>][]\nexcept that it does not spawn a shell. Rather, the specified executable <code>file</code>\nis spawned directly as a new process making it slightly more efficient than\n[<code>child_process.exec()</code>][].\n\n</p>\n<p>The same options as <code>child_process.exec()</code> are supported. Since a shell is not\nspawned, behaviors such as I/O redirection and file globbing are not supported.\n\n</p>\n<pre><code>const execFile = require(&#39;child_process&#39;).execFile;\nconst child = execFile(&#39;node&#39;, [&#39;--version&#39;], (error, stdout, stderr) =&gt; {\n if (error) {\n throw error;\n }\n console.log(stdout);\n});</code></pre>\n"
}, },
{ {
"textRaw": "child_process.fork(modulePath[, args][, options])", "textRaw": "child_process.fork(modulePath[, args][, options])",
...@@ -331,10 +331,10 @@ ...@@ -331,10 +331,10 @@
"desc": "List of string arguments passed to the executable" "desc": "List of string arguments passed to the executable"
}, },
{ {
"textRaw": "`silent` {Boolean} If true, stdin, stdout, and stderr of the child will be piped to the parent, otherwise they will be inherited from the parent, see the `'pipe'` and `'inherit'` options for [`spawn()`][]'s [`stdio`][] for more details (default is false) ", "textRaw": "`silent` {Boolean} If true, stdin, stdout, and stderr of the child will be piped to the parent, otherwise they will be inherited from the parent, see the `'pipe'` and `'inherit'` options for [`child_process.spawn()`][]'s [`stdio`][] for more details (default is false) ",
"name": "silent", "name": "silent",
"type": "Boolean", "type": "Boolean",
"desc": "If true, stdin, stdout, and stderr of the child will be piped to the parent, otherwise they will be inherited from the parent, see the `'pipe'` and `'inherit'` options for [`spawn()`][]'s [`stdio`][] for more details (default is false)" "desc": "If true, stdin, stdout, and stderr of the child will be piped to the parent, otherwise they will be inherited from the parent, see the `'pipe'` and `'inherit'` options for [`child_process.spawn()`][]'s [`stdio`][] for more details (default is false)"
}, },
{ {
"textRaw": "`uid` {Number} Sets the user identity of the process. (See setuid(2).) ", "textRaw": "`uid` {Number} Sets the user identity of the process. (See setuid(2).) ",
......
...@@ -60,8 +60,8 @@ The `child_process.spawn()`, `child_process.fork()`, `child_process.exec()`, ...@@ -60,8 +60,8 @@ The `child_process.spawn()`, `child_process.fork()`, `child_process.exec()`,
and `child_process.execFile()` methods all follow the idiomatic asynchronous and `child_process.execFile()` methods all follow the idiomatic asynchronous
programming pattern typical of other Node.js APIs. programming pattern typical of other Node.js APIs.
Each of the methods returns a [ChildProcess][] instance. These objects Each of the methods returns a [`ChildProcess`][] instance. These objects
implement the Node.js [EventEmitter][] API, allowing the parent process to implement the Node.js [`EventEmitter`][] API, allowing the parent process to
register listener functions that are called when certain events occur during register listener functions that are called when certain events occur during
the life cycle of the child process. the life cycle of the child process.
...@@ -175,7 +175,7 @@ replace the existing process and uses a shell to execute the command.* ...@@ -175,7 +175,7 @@ replace the existing process and uses a shell to execute the command.*
### child_process.execFile(file[, args][, options][, callback]) ### child_process.execFile(file[, args][, options][, callback])
* `file` {String} The filename of the program to run * `file` {String} A path to an executable file
* `args` {Array} List of string arguments * `args` {Array} List of string arguments
* `options` {Object} * `options` {Object}
* `cwd` {String} Current working directory of the child process * `cwd` {String} Current working directory of the child process
...@@ -193,20 +193,20 @@ replace the existing process and uses a shell to execute the command.* ...@@ -193,20 +193,20 @@ replace the existing process and uses a shell to execute the command.*
* `stderr` {Buffer} * `stderr` {Buffer}
* Return: ChildProcess object * Return: ChildProcess object
The `child_process.execFile()` method is similar to [`child_process.exec()`][] The `child_process.execFile()` function is similar to [`child_process.exec()`][]
except that it does not first spawn a shell. Rather, the specified `command` is except that it does not spawn a shell. Rather, the specified executable `file`
spawned directly as a new process making it slightly more efficient than is spawned directly as a new process making it slightly more efficient than
[`child_process.exec()`][]. The same options are support by both [`child_process.exec()`][].
`child_process.exec()` and `child_process.execFile()`.
const exec = require('child_process').execFile; The same options as `child_process.exec()` are supported. Since a shell is not
const child = execFile('cat *.js bad_file | wc -l', spawned, behaviors such as I/O redirection and file globbing are not supported.
(error, stdout, stderr) => {
console.log(`stdout: ${stdout}`); const execFile = require('child_process').execFile;
console.log(`stderr: ${stderr}`); const child = execFile('node', ['--version'], (error, stdout, stderr) => {
if (error !== null) { if (error) {
console.log(`exec error: ${error}`); throw error;
} }
console.log(stdout);
}); });
### child_process.fork(modulePath[, args][, options]) ### child_process.fork(modulePath[, args][, options])
...@@ -221,9 +221,8 @@ spawned directly as a new process making it slightly more efficient than ...@@ -221,9 +221,8 @@ spawned directly as a new process making it slightly more efficient than
(Default: `process.execArgv`) (Default: `process.execArgv`)
* `silent` {Boolean} If true, stdin, stdout, and stderr of the child will be * `silent` {Boolean} If true, stdin, stdout, and stderr of the child will be
piped to the parent, otherwise they will be inherited from the parent, see piped to the parent, otherwise they will be inherited from the parent, see
the `'pipe'` and `'inherit'` options for [`spawn()`][]'s [`stdio`][] for the `'pipe'` and `'inherit'` options for [`child_process.spawn()`][]'s
more details [`stdio`][] for more details (default is false)
(default is false)
* `uid` {Number} Sets the user identity of the process. (See setuid(2).) * `uid` {Number} Sets the user identity of the process. (See setuid(2).)
* `gid` {Number} Sets the group identity of the process. (See setgid(2).) * `gid` {Number} Sets the group identity of the process. (See setgid(2).)
* Return: ChildProcess object * Return: ChildProcess object
...@@ -922,6 +921,7 @@ then this will be `undefined`. ...@@ -922,6 +921,7 @@ then this will be `undefined`.
to the same value.