summaryrefslogtreecommitdiff
path: root/doc/api/child_process.md
Commit message (Collapse)AuthorAgeFilesLines
* doc: abort controller emits error in child processDebadree Chatterjee2023-01-071-3/+4
| | | | | | Fixes: https://github.com/nodejs/node/issues/46036 PR-URL: https://github.com/nodejs/node/pull/46072 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
* doc: use console.error for error case in child_process and dgramDeokjin Kim2022-12-021-2/+2
| | | | | | | | console.error is more suitable than console.log for error case. PR-URL: https://github.com/nodejs/node/pull/45690 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
* doc: add lint rule to enforce trailing commasAntoine du Hamel2022-11-171-8/+8
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/45471 Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* doc: remove "currently" and comma splice from child_process.mdRich Trott2022-09-271-6/+6
| | | | | | | | | | | | Remove redundant use of "currently" and fix a comma splice. PR-URL: https://github.com/nodejs/node/pull/44789 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com> Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
* doc: clarify subprocess.stdout/in/err propertyKohei Ueno2022-07-241-9/+9
| | | | | | PR-URL: https://github.com/nodejs/node/pull/43910 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com>
* doc: add `node:` prefix for all core modulesAntoine du Hamel2022-04-201-45/+45
| | | | | | | | | | | | | | | | | | Some core modules can be loaded with or without the `node:` prefix. Using the prefix disambiguates which specifiers refer to core modules. This commit updates the docs to use the prefix everywhere a core module is referenced. PR-URL: https://github.com/nodejs/node/pull/42752 Fixes: https://github.com/nodejs/node/issues/38343 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
* doc: clarify path search in `child_process.spawn`Damjan Cvetko2022-03-151-2/+5
| | | | | | | | | | | | | | The documentation about command lookup could be more clear and note differences between Windows and Linux/OSX. Current text gives the impression that if one passes `options.env` without `PATH`, the path search will fall back on `process.env.PATH`. In reality, passing environment without `PATH` to `execvp` causes it to look for the binary only in `/usr/bin:/bin`. Also Windows behaves different and more in line with the current documentation text. PR-URL: https://github.com/nodejs/node/pull/41418 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* doc: improve pipe descriptionMikael Finstad2022-03-131-0/+3
| | | | | | | | | | | | | | | | | I spent hours trying to make it work only to learn that it's not supported in node anymore, so I thought I'd save other people the time in the future. https://groups.google.com/g/nodejs/c/SxNKLclbM5k?pli=1 PR-URL: https://github.com/nodejs/node/pull/42295 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com>
* 2022-02-08, Version 16.14.0 'Gallium' (LTS)Danielle Adams2022-02-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notable changes: Importing JSON modules now requires experimental import assertions syntax This release adds experimental support for the import assertions stage 3 proposal. To keep Node.js ESM implementation as compatible as possible with the HTML spec, import assertions are now required to import JSON modules (still behind the `--experimental-json-modules` CLI flag): ```mjs import info from './package.json' assert { type: 'json' }; ``` Or use dynamic import: ```mjs const info = await import('./package.json', { assert: { type: 'json' } }); ``` Contributed by Antoine du Hamel and Geoffrey Booth https://github.com/nodejs/node/pull/40250 Other notable changes: * async_hooks: * (SEMVER-MINOR) expose async_wrap providers (Rafael Gonzaga) https://github.com/nodejs/node/pull/40760 * child_process: * (SEMVER-MINOR) add support for URL to `cp.fork` (Antoine du Hamel) https://github.com/nodejs/node/pull/41225 * doc: * add @Mesteery to collaborators (Mestery) https://github.com/nodejs/node/pull/41543 * add @bnb as a collaborator (Tierney Cyren) https://github.com/nodejs/node/pull/41100 * esm: * (SEMVER-MINOR) graduate capturerejections to supported (James M Snell) https://github.com/nodejs/node/pull/41267 * (SEMVER-MINOR) add EventEmitterAsyncResource to core (James M Snell) https://github.com/nodejs/node/pull/41246 * events: * (SEMVER-MINOR) propagate weak option for kNewListener (James M Snell) https://github.com/nodejs/node/pull/40899 * fs: * (SEMVER-MINOR) accept URL as argument for `fs.rm` and `fs.rmSync` (Antoine du Hamel) https://github.com/nodejs/node/pull/41132 * lib: * (SEMVER-MINOR) make AbortSignal cloneable/transferable (James M Snell) https://github.com/nodejs/node/pull/41050 * (SEMVER-MINOR) add AbortSignal.timeout (James M Snell) https://github.com/nodejs/node/pull/40899 * (SEMVER-MINOR) add reason to AbortSignal (James M Snell) https://github.com/nodejs/node/pull/40807 * (SEMVER-MINOR) add unsubscribe method to non-active DC channels (simon-id) https://github.com/nodejs/node/pull/40433 * (SEMVER-MINOR) add return value for DC channel.unsubscribe (simon-id) https://github.com/nodejs/node/pull/40433 * loader: * (SEMVER-MINOR) return package format from defaultResolve if known (Gabriel Bota) https://github.com/nodejs/node/pull/40980 * perf_hooks: * (SEMVER-MINOR) multiple fixes for Histogram (James M Snell) https://github.com/nodejs/node/pull/41153 * process: * (SEMVER-MINOR) add `getActiveResourcesInfo()` (Darshan Sen) https://github.com/nodejs/node/pull/40813 * src: * (SEMVER-MINOR) add x509.fingerprint512 to crypto module (3nprob) https://github.com/nodejs/node/pull/39809 * (SEMVER-MINOR) add flags for controlling process behavior (Cheng Zhao) https://github.com/nodejs/node/pull/40339 * stream: * (SEMVER-MINOR) add filter method to readable (Benjamin Gruenbaum) https://github.com/nodejs/node/pull/41354 * (SEMVER-MINOR) add isReadable helper (Robert Nagy) https://github.com/nodejs/node/pull/41199 * (SEMVER-MINOR) add map method to Readable (Benjamin Gruenbaum) https://github.com/nodejs/node/pull/40815 * deprecate thenable support (Antoine du Hamel) https://github.com/nodejs/node/pull/40860 * util: * (SEMVER-MINOR) pass through the inspect function to custom inspect functions (Ruben Bridgewater) https://github.com/nodejs/node/pull/41019 * (SEMVER-MINOR) add numericSeparator to util.inspect (Ruben Bridgewater) https://github.com/nodejs/node/pull/41003 * (SEMVER-MINOR) always visualize cause property in errors during inspection (Ruben Bridgewater) https://github.com/nodejs/node/pull/41002 * timers: * (SEMVER-MINOR) add experimental scheduler api (James M Snell) https://github.com/nodejs/node/pull/40909 * v8: * (SEMVER-MINOR) multi-tenant promise hook api (Stephen Belanger) https://github.com/nodejs/node/pull/39283 PR-URL: https://github.com/nodejs/node/pull/41804
* 2022-01-18, Version 17.4.0 (Current)Michaël Zasso2022-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Notable changes: child_process: * (SEMVER-MINOR) add support for URL to `cp.fork` (Antoine du Hamel) https://github.com/nodejs/node/pull/41225 crypto: * (SEMVER-MINOR) alias webcrypto.subtle and webcrypto.getRandomValues on crypto (James M Snell) https://github.com/nodejs/node/pull/41266 doc: * add Mesteery to collaborators (Mestery) https://github.com/nodejs/node/pull/41543 events: * (SEMVER-MINOR) graduate capturerejections to supported (James M Snell) https://github.com/nodejs/node/pull/41267 * (SEMVER-MINOR) add EventEmitterAsyncResource to core (James M Snell) https://github.com/nodejs/node/pull/41246 loader: * (SEMVER-MINOR) return package format from defaultResolve if known (Gabriel Bota) https://github.com/nodejs/node/pull/40980 perf_hooks: * (SEMVER-MINOR) multiple fixes for Histogram (James M Snell) https://github.com/nodejs/node/pull/41153 stream: * (SEMVER-MINOR) add filter method to readable (Benjamin Gruenbaum, Robert Nagy) https://github.com/nodejs/node/pull/41354 * (SEMVER-MINOR) add isReadable helper (Robert Nagy) https://github.com/nodejs/node/pull/41199 * (SEMVER-MINOR) add map method to Readable (Benjamin Gruenbaum, Robert Nagy) https://github.com/nodejs/node/pull/40815 PR-URL: https://github.com/nodejs/node/pull/41557
* child_process: add support for URL to `cp.fork`Antoine du Hamel2021-12-191-1/+6
| | | | | PR-URL: https://github.com/nodejs/node/pull/41225 Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* tools: avoid unnecessary escaping in markdown formatterRich Trott2021-10-311-1/+1
| | | | | | | | | Update mdast-util-to-markdown to 1.2.4 which reduces unnecessary escaping of `_` and some other characters. Re-run markdown formatter. PR-URL: https://github.com/nodejs/node/pull/40645 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
* doc: format doc/api/*.md with markdown formatterRich Trott2021-10-201-17/+47
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/40403 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Zijian Liu <lxxyxzj@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
* 2021-09-28, Version 14.18.0 'Fermium' (LTS)Michaël Zasso2021-09-281-12/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notable changes: assert: * change status of legacy asserts (James M Snell) https://github.com/nodejs/node/pull/38113 buffer: * (SEMVER-MINOR) introduce Blob (James M Snell) https://github.com/nodejs/node/pull/36811 * (SEMVER-MINOR) add base64url encoding option (Filip Skokan) https://github.com/nodejs/node/pull/36952 child_process: * (SEMVER-MINOR) allow `options.cwd` receive a URL (Khaidi Chu) https://github.com/nodejs/node/pull/38862 * (SEMVER-MINOR) add timeout to spawn and fork (Nitzan Uziely) https://github.com/nodejs/node/pull/37256 * (SEMVER-MINOR) allow promisified exec to be cancel (Carlos Fuentes) https://github.com/nodejs/node/pull/34249 * (SEMVER-MINOR) add 'overlapped' stdio flag (Thiago Padilha) https://github.com/nodejs/node/pull/29412 cli: * (SEMVER-MINOR) add -C alias for --conditions flag (Guy Bedford) https://github.com/nodejs/node/pull/38755 * (SEMVER-MINOR) add --node-memory-debug option (Anna Henningsen) https://github.com/nodejs/node/pull/35537 dns: * (SEMVER-MINOR) add "tries" option to Resolve options (Luan Devecchi) https://github.com/nodejs/node/pull/39610 * (SEMVER-MINOR) allow `--dns-result-order` to change default dns verbatim (Ouyang Yadong) https://github.com/nodejs/node/pull/38099 doc: * (SEMVER-MINOR) add missing change to resolver ctor (Luan Devecchi) https://github.com/nodejs/node/pull/39610 * refactor fs docs structure (James M Snell) https://github.com/nodejs/node/pull/37170 errors: * (SEMVER-MINOR) remove experimental from --enable-source-maps (Benjamin Coe) https://github.com/nodejs/node/pull/37362 esm: * deprecate legacy main lookup for modules (Guy Bedford) https://github.com/nodejs/node/pull/36918 fs: * (SEMVER-MINOR) allow empty string for temp directory prefix (Voltrex) https://github.com/nodejs/node/pull/39028 * (SEMVER-MINOR) allow no-params fsPromises fileHandle read (Nitzan Uziely) https://github.com/nodejs/node/pull/38287 * (SEMVER-MINOR) add support for async iterators to `fsPromises.writeFile` (HiroyukiYagihashi) https://github.com/nodejs/node/pull/37490 * improve fsPromises readFile performance (Nitzan Uziely) https://github.com/nodejs/node/pull/37608 * (SEMVER-MINOR) add fsPromises.watch() (James M Snell) https://github.com/nodejs/node/pull/37179 * (SEMVER-MINOR) allow `position` parameter to be a `BigInt` in read and readSync (Darshan Sen) https://github.com/nodejs/node/pull/36190 http2: * (SEMVER-MINOR) add support for sensitive headers (Anna Henningsen) https://github.com/nodejs/node/pull/34145 * (SEMVER-MINOR) allow setting the local window size of a session (Yongsheng Zhang) https://github.com/nodejs/node/pull/35978 inspector: * mark as stable (Gireesh Punathil) https://github.com/nodejs/node/pull/37748 module: * (SEMVER-MINOR) add support for `URL` to `import.meta.resolve` (Antoine du Hamel) https://github.com/nodejs/node/pull/38587 * (SEMVER-MINOR) add support for `node:`‑prefixed `require(…)` calls (ExE Boss) https://github.com/nodejs/node/pull/37246 net: * (SEMVER-MINOR) introduce net.BlockList (James M Snell) https://github.com/nodejs/node/pull/34625 node-api: * (SEMVER-MINOR) allow retrieval of add-on file name (Gabriel Schulhof) https://github.com/nodejs/node/pull/37195 os: * (SEMVER-MINOR) add os.devNull (Luigi Pinca) https://github.com/nodejs/node/pull/38569 perf_hooks: * (SEMVER-MINOR) introduce createHistogram (James M Snell) https://github.com/nodejs/node/pull/37155 process: * (SEMVER-MINOR) add api to enable source-maps programmatically (legendecas) https://github.com/nodejs/node/pull/39085 * (SEMVER-MINOR) add `'worker'` event (James M Snell) https://github.com/nodejs/node/pull/38659 * (SEMVER-MINOR) add direct access to rss without iterating pages (Adrien Maret) https://github.com/nodejs/node/pull/34291 readline: * (SEMVER-MINOR) add AbortSignal support to interface (Nitzan Uziely) https://github.com/nodejs/node/pull/37932 * (SEMVER-MINOR) add support for the AbortController to the question method (Mattias Runge-Broberg) https://github.com/nodejs/node/pull/33676 * (SEMVER-MINOR) add history event and option to set initial history (Mattias Runge-Broberg) https://github.com/nodejs/node/pull/33662 repl: * (SEMVER-MINOR) add auto‑completion for `node:`‑prefixed `require(…)` calls (ExE Boss) https://github.com/nodejs/node/pull/37246 src: * (SEMVER-MINOR) call overload ctor from the original ctor (Darshan Sen) https://github.com/nodejs/node/pull/39768 * (SEMVER-MINOR) add a constructor overload for CallbackScope (Darshan Sen) https://github.com/nodejs/node/pull/39768 * (SEMVER-MINOR) allow to negate boolean CLI flags (Michaël Zasso) https://github.com/nodejs/node/pull/39023 * (SEMVER-MINOR) add --heapsnapshot-near-heap-limit option (Joyee Cheung) https://github.com/nodejs/node/pull/33010 * (SEMVER-MINOR) add way to get IsolateData and allocator from Environment (Anna Henningsen) https://github.com/nodejs/node/pull/36441 * (SEMVER-MINOR) allow preventing SetPrepareStackTraceCallback (Shelley Vohr) https://github.com/nodejs/node/pull/36447 * (SEMVER-MINOR) add maybe versions of EmitExit and EmitBeforeExit (Anna Henningsen) https://github.com/nodejs/node/pull/35486 stream: * (SEMVER-MINOR) add readableDidRead if has been read from (Robert Nagy) https://github.com/nodejs/node/pull/39589 * (SEMVER-MINOR) pipeline accept Buffer as a valid first argument (Nitzan Uziely) https://github.com/nodejs/node/pull/37739 tls: * (SEMVER-MINOR) allow reading data into a static buffer (Andrey Pechkurov) https://github.com/nodejs/node/pull/35753 tools: * (SEMVER-MINOR) add `Worker` to type-parser (James M Snell) https://github.com/nodejs/node/pull/38659 url: * (SEMVER-MINOR) expose urlToHttpOptions utility (Yongsheng Zhang) https://github.com/nodejs/node/pull/35960 util: * (SEMVER-MINOR) expose toUSVString (Robert Nagy) https://github.com/nodejs/node/pull/39814 v8: * (SEMVER-MINOR) implement v8.stopCoverage() (Joyee Cheung) https://github.com/nodejs/node/pull/33807 * (SEMVER-MINOR) implement v8.takeCoverage() (Joyee Cheung) https://github.com/nodejs/node/pull/33807 worker: * (SEMVER-MINOR) add setEnvironmentData/getEnvironmentData (James M Snell) https://github.com/nodejs/node/pull/37486 PR-URL: https://github.com/nodejs/node/pull/39990
* doc: anchor link parity between markdown and html-generated docsfoxxyz2021-08-301-38/+38
| | | | | | | | | | | | | | | | | | | | | | | Main changes: - Replace current HTML anchor generation to match header anchor generation in Github markdown. - Remove unnecessary double namespacing on generated anchors/links (E.G. `esm.md#loaders` instead of `esm.md#esm_loaders`). - Anchors/links are automatically prefixed with their respective modules when concatenated for usage in `all.html`. Benefits: - All anchor links within and between markdown API docs actually work. - Adding new anchor links no longer requires contributors to generate the HTML docs first to look up the correct anchors. - Anchors are much shorter. - All previous anchor links are preserved by generating hidden legacy anchors. PR-URL: https://github.com/nodejs/node/pull/39304 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
* 2021-06-23, Version 16.4.0 (Current)Danielle Adams2021-06-231-7/+7
| | | | | | | | | | | | | | Notable changes: * async_hooks: * stabilize part of AsyncLocalStorage (Vladimir de Turckheim) https://github.com/nodejs/node/pull/37675 * deps: * upgrade npm to 7.18.1 (npm-robot) https://github.com/nodejs/node/pull/39065 * update V8 to 9.1.269.36 (Michaël Zasso) https://github.com/nodejs/node/pull/38273 * dns: * allow `--dns-result-order` to change default dns verbatim (Ouyang Yadong) https://github.com/nodejs/node/pull/38099 PR-URL: https://github.com/nodejs/node/pull/39031
* child_process: allow `options.cwd` receive a URLXadillaX2021-06-041-7/+35
| | | | | | | PR-URL: https://github.com/nodejs/node/pull/38862 Fixes: https://github.com/nodejs/node/issues/38861 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
* 2021-05-11, Version 14.17.0 'Fermium' (LTS)Danielle Adams2021-05-111-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notable Changes: Diagnostics channel (experimental module): `diagnostics_channel` is a new experimental module that provides an API to create named channels to report arbitrary message data for diagnostics purposes. The module was initially introduced in Node.js v15.1.0 and is backported to v14.17.0 to enable testing it at a larger scale. With `diagnostics_channel`, Node.js core and module authors can publish contextual data about what they are doing at a given time. This could be the hostname and query string of a mysql query, for example. Just create a named channel with `dc.channel(name)` and call `channel.publish(data)` to send the data to any listeners to that channel. ```js const dc = require('diagnostics_channel'); const channel = dc.channel('mysql.query'); MySQL.prototype.query = function query(queryString, values, callback) { // Broadcast query information whenever a query is made channel.publish({ query: queryString, host: this.hostname, }); this.doQuery(queryString, values, callback); }; ``` Channels are like one big global event emitter but are split into separate objects to ensure they get the best performance. If nothing is listening to the channel, the publishing overhead should be as close to zero as possible. Consuming channel data is as easy as using `channel.subscribe(listener)` to run a function whenever a message is published to that channel. ```js const dc = require('diagnostics_channel'); const channel = dc.channel('mysql.query'); channel.subscribe(({ query, host }) => { console.log(`mysql query to ${host}: ${query}`); }); ``` The data captured can be used to provide context for what an app is doing at a given time. This can be used for things like augmenting tracing data, tracking network and filesystem activity, logging queries, and many other things. It's also a very useful data source for diagnostics tools to provide a clearer picture of exactly what the application is doing at a given point in the data they are presenting. Contributed by Stephen Belanger (https://github.com/nodejs/node/pull/34895). UUID support in the crypto module: The new `crypto.randomUUID()` method now allows to generate random [RFC 4122](https://www.rfc-editor.org/rfc/rfc4122.txt) Version 4 UUID strings: ```js const { randomUUID } = require('crypto'); console.log(randomUUID()); // 'aa7c91a1-f8fc-4339-b9db-f93fc7233429' ``` Contributed by James M Snell (https://github.com/nodejs/node/pull/36729). Experimental support for `AbortController` and `AbortSignal`: Node.js 14.17.0 adds experimental partial support for `AbortController` and `AbortSignal`. Both constructors can be enabled globally using the `--experimental-abortcontroller` flag. Additionally, several Node.js APIs have been updated to support `AbortSignal` for cancellation. It is not mandatory to use the built-in constructors with them. Any spec-compliant third-party alternatives should be compatible. `AbortSignal` support was added to the following methods: * `child_process.exec` * `child_process.execFile` * `child_process.fork` * `child_process.spawn` * `dgram.createSocket` * `events.on` * `events.once` * `fs.readFile` * `fs.watch` * `fs.writeFile` * `http.request` * `https.request` * `http2Session.request` * The promisified variants of `setImmediate` and `setTimeout` Other notable changes: * doc: * revoke deprecation of legacy url, change status to legacy (James M Snell) (https://github.com/nodejs/node/pull/37784) * add legacy status to stability index (James M Snell) (https://github.com/nodejs/node/pull/37784) * upgrade stability status of report API (Gireesh Punathil) (https://github.com/nodejs/node/pull/35654) * deps: * V8: Backport various patches for Apple Silicon support (BoHong Li) (https://github.com/nodejs/node/pull/38051) * update ICU to 68.1 (Michaël Zasso) (https://github.com/nodejs/node/pull/36187) * upgrade to libuv 1.41.0 (Colin Ihrig) (https://github.com/nodejs/node/pull/37360) * http: * add http.ClientRequest.getRawHeaderNames() (simov) (https://github.com/nodejs/node/pull/37660) * report request start and end with diagnostics\_channel (Stephen Belanger) (https://github.com/nodejs/node/pull/34895) * util: * add getSystemErrorMap() impl (eladkeyshawn) (https://github.com/nodejs/node/pull/38101) PR-URL: https://github.com/nodejs/node/pull/38507
* doc: clarify child_process close eventNitzan Uziely2021-04-121-3/+5
| | | | | | | | | | | | clarify the 'close' event description in the child_process docs. fixes: https://github.com/nodejs/node/issues/37998 PR-URL: https://github.com/nodejs/node/pull/38181 Fixes: https://github.com/nodejs/node/issues/37998 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* 2021-03-31, Version 15.13.0 (Current)Ruy Adorno2021-03-311-2/+2
| | | | | | | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/37977 Notable changes: * buffer: * implement btoa and atob (James M Snell) https://github.com/nodejs/node/pull/37529 * deps: * upgrade npm to 7.7.6 (Ruy Adorno) https://github.com/nodejs/node/pull/37968 * doc: * add legacy status to stability index (James M Snell) https://github.com/nodejs/node/pull/37784 * add @linkgoron to collaborators (Nitzan Uziely) https://github.com/nodejs/node/pull/37817 * http: * add http.ClientRequest.getRawHeaderNames() (simov) https://github.com/nodejs/node/pull/37660
* doc: add Windows-specific info to subprocess.kill()João Lucas Lucchetta2021-03-301-0/+6
| | | | | | | | | | | | Clarify the inner workings of .kill on Windows, since termination signals are not available there. Fixes: https://github.com/nodejs/node/issues/34858 PR-URL: https://github.com/nodejs/node/pull/34867 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* doc: clarify when child process 'spawn' event is *not* emittedMatthew Francis Brunetti2021-03-221-0/+2
| | | | | | | | | | Making this clarification in response to a comment on GitHub: https://github.com/nodejs/node/issues/35288#issuecomment-802811813 PR-URL: https://github.com/nodejs/node/pull/37833 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* child_process: add timeout to spawn and forkNitzan Uziely2021-03-191-4/+14
| | | | | | | | | Add support for timeout to spawn and fork. Fixes: https://github.com/nodejs/node/issues/27639 PR-URL: https://github.com/nodejs/node/pull/37256 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* doc: refactor signal info in child_process.mdDarshan Sen2021-03-041-6/+50
| | | | | | | | | | | | | * Since exec calls execFile and execFile internally calls spawn with options.signal, the signal parameter has been documented under exec as well. * Refactor the description of signal under all the functions. * Add examples of usage of signal under all the functions and add missing requires in the other examples. PR-URL: https://github.com/nodejs/node/pull/37528 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
* 2021-03-03, Version 15.11.0 (Current)Michaël Zasso2021-03-031-2/+2
| | | | | | | | | | | Notable changes: crypto: * (SEMVER-MINOR) make FIPS related options always awailable (Vít Ondruch) https://github.com/nodejs/node/pull/36341 errors: * (SEMVER-MINOR) remove experimental from --enable-source-maps (Benjamin Coe) https://github.com/nodejs/node/pull/37362 PR-URL: https://github.com/nodejs/node/pull/37569
* child_process: fix spawn and fork abort behaviorNitzan Uziely2021-02-271-0/+10
| | | | | | | | | | | | Fix AbortSignal in Spawn which doesn't actually abort the process, and fork can emit an AbortError even if the process was already exited. Add documentation For killSignal. Fixes: https://github.com/nodejs/node/issues/37273 PR-URL: https://github.com/nodejs/node/pull/37325 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
* doc,child_process: `pid` can be `undefined` when `ENOENT`dr-js2021-02-221-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | From the code `nodejs@8` and up should behave the same: github.com/nodejs/node/blame/v8.17.0/lib/internal/child_process.js#L290 And a short test snippet: ```js const { spawn } = require('child_process') const subProcess = spawn('non-exist-command') subProcess.on('error', (error) => console.warn('mute Unhandled "error" event:', error)) console.log('- pid:', subProcess.pid) process.nextTick(() => console.log('- after error emit')) console.log('== end of test ==') ``` Note: the sync spawn result `pid` currently do not follow this pattern. Co-authored-by: Rich Trott <rtrott@gmail.com> PR-URL: https://github.com/nodejs/node/pull/37014 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
* doc,lib: prepare for stricter multi-line array lintingRich Trott2021-02-191-2/+2
| | | | | | | | We're about to turn on a requirement for dangling commas. PR-URL: https://github.com/nodejs/node/pull/37088 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
* 2021-01-14, Version 15.6.0 (Current)Danielle Adams2021-01-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/36889 Notable changes: * child_process: * add 'overlapped' stdio flag (Thiago Padilha) (https://github.com/nodejs/node/pull/29412) * support AbortSignal in fork (Benjamin Gruenbaum) (https://github.com/nodejs/node/pull/36603) * crypto: * implement basic secure heap support (James M Snell) (https://github.com/nodejs/node/pull/36779) * fixup bug in keygen error handling (James M Snell) (https://github.com/nodejs/node/pull/36779) * introduce X509Certificate API (James M Snell) (https://github.com/nodejs/node/pull/36804) * implement randomuuid (James M Snell) (https://github.com/nodejs/node/pull/36729) * doc: * update release key for Danielle Adams (Danielle Adams) (https://github.com/nodejs/node/pull/36793) * add dnlup to collaborators (Daniele Belardi) (https://github.com/nodejs/node/pull/36849) * add panva to collaborators (Filip Skokan) (https://github.com/nodejs/node/pull/36802) * add yashLadha to collaborator (Yash Ladha) (https://github.com/nodejs/node/pull/36666) * http: * set lifo as the default scheduling strategy in Agent (Matteo Collina) (https://github.com/nodejs/node/pull/36685) * net: * support abortSignal in server.listen (Nitzan Uziely) (https://github.com/nodejs/node/pull/36623) * process: * add direct access to rss without iterating pages (Adrien Maret) (https://github.com/nodejs/node/pull/34291) * v8: * fix native  constructors (ExE Boss) (https://github.com/nodejs/node/pull/36549)
* doc: clarify child_process.exec inherits cwdugultopu2021-01-091-1/+1
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/36809 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Pooja D P <Pooja.D.P@ibm.com> Reviewed-By: Yash Ladha <yash@yashladha.in> Reviewed-By: James M Snell <jasnell@gmail.com>
* doc: clarify subprocess.stdout/in/err/io propertiesJames M Snell2021-01-071-0/+12
| | | | | | | | | | | The various `subprocess.stdwhatever` properties can be null or undefined in certain conditions. Fixes: https://github.com/nodejs/node/issues/33458 Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/36784 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* doc: fix broken link for ChildProcessJames M Snell2021-01-061-1/+1
| | | | | | | | | | | | Fixes: https://github.com/nodejs/node/issues/36787 Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/36788 Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
* child_process: add 'overlapped' stdio flagThiago Padilha2021-01-031-6/+16
| | | | | | | | | | | The 'overlapped' value sets the UV_OVERLAPPED_PIPE libuv flag in the child process stdio. Fixes: https://github.com/nodejs/node/issues/29238 PR-URL: https://github.com/nodejs/node/pull/29412 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
* child_process: support AbortSignal in forkBenjamin Gruenbaum2020-12-241-2/+9
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/36603 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* 2020-12-22, Version 15.5.0 (Current)Michaël Zasso2020-12-221-1/+1
| | | | | | | | | | | | | | | | | | Notable changes: child_process: * (SEMVER-MINOR) add signal support to spawn (Benjamin Gruenbaum) https://github.com/nodejs/node/pull/36432 doc: * add PoojaDurgad to collaborators (Pooja D P) https://github.com/nodejs/node/pull/36511 lib: * (SEMVER-MINOR) support BigInt in querystring.stringify (raisinten) https://github.com/nodejs/node/pull/36499 src: * (SEMVER-MINOR) add way to get IsolateData and allocator from Environment (Anna Henningsen) https://github.com/nodejs/node/pull/36441 * (SEMVER-MINOR) allow preventing SetPrepareStackTraceCallback (Shelley Vohr) https://github.com/nodejs/node/pull/36447 stream: * (SEMVER-MINOR) support abortsignal in constructor (Benjamin Gruenbaum) https://github.com/nodejs/node/pull/36431 PR-URL: https://github.com/nodejs/node/pull/36597
* child_process: add signal support to spawnBenjamin Gruenbaum2020-12-121-2/+21
| | | | | | PR-URL: https://github.com/nodejs/node/pull/36432 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* 2020-12-09, Version 15.4.0 (Current)Danielle Adams2020-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | PR-URL: https://github.com/nodejs/node/pull/36435 Notable changes: * child_processes: * add AbortSignal support (Benjamin Gruenbaum) (https://github.com/nodejs/node/pull/36308) * deps: * update ICU to 68.1 (Michaël Zasso) (https://github.com/nodejs/node/pull/36187) * events: * support signal in EventTarget (Benjamin Gruenbaum) (https://github.com/nodejs/node/pull/36258) * graduate Event, EventTarget, AbortController (James M Snell) (https://github.com/nodejs/node/pull/35949) * http: * enable call chaining with setHeader() (pooja d.p) (https://github.com/nodejs/node/pull/35924) * module: * add isPreloading indicator (James M Snell) (https://github.com/nodejs/node/pull/36263) * stream: * support abort signal (Benjamin Gruenbaum) (https://github.com/nodejs/node/pull/36061) * add FileHandle support to Read/WriteStream (Momtchil Momtchev) (https://github.com/nodejs/node/pull/35922) * worker: * add experimental BroadcastChannel (James M Snell) (https://github.com/nodejs/node/pull/36271)
* child_process: add AbortSignal supportBenjamin Gruenbaum2020-12-061-0/+17
| | | | | PR-URL: https://github.com/nodejs/node/pull/36308 Reviewed-By: Rich Trott <rtrott@gmail.com>
* doc: document the error when cwd not exists in child_process.spawnFeelyChau2020-11-151-1/+4
| | | | | | | | | | If the option cwd does not exist, the error ENOENT is the same as the error emitted when the command does not exist, it's confusing. PR-URL: https://github.com/nodejs/node/pull/34505 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
* 2020-11-04, Version 15.1.0 (Current)Michaël Zasso2020-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Notable changes: child_process: * (SEMVER-MINOR) add ChildProcess 'spawn' event (Matthew Francis Brunetti) https://github.com/nodejs/node/pull/35369 dns: * (SEMVER-MINOR) add setLocalAddress to Resolver (Josh Dague) https://github.com/nodejs/node/pull/34824 http: * (SEMVER-MINOR) report request start and end with diagnostics_channel (Stephen Belanger) https://github.com/nodejs/node/pull/34895 http2: * (SEMVER-MINOR) add updateSettings to both http2 servers (Vincent Boivin) https://github.com/nodejs/node/pull/35383 lib: * (SEMVER-MINOR) create diagnostics_channel module (Stephen Belanger) https://github.com/nodejs/node/pull/34895 src: * (SEMVER-MINOR) add --heapsnapshot-near-heap-limit option (Joyee Cheung) https://github.com/nodejs/node/pull/33010 v8: * (SEMVER-MINOR) implement v8.stopCoverage() (Joyee Cheung) https://github.com/nodejs/node/pull/33807 * (SEMVER-MINOR) implement v8.takeCoverage() (Joyee Cheung) https://github.com/nodejs/node/pull/33807 worker: * (SEMVER-MINOR) add eventLoopUtilization() (Trevor Norris) https://github.com/nodejs/node/pull/35664 PR-URL: https://github.com/nodejs/node/pull/35948
* child_process: add ChildProcess 'spawn' eventMatthew Francis Brunetti2020-10-281-0/+15
| | | | | | | | | | The new event signals that the subprocess has spawned successfully and no 'error' event will be emitted from failing to spawn. Fixes: https://github.com/nodejs/node/issues/35288 PR-URL: https://github.com/nodejs/node/pull/35369 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
* doc: harmonize version list style in YAML commentsAntoine du Hamel2020-10-091-2/+6
| | | | | | | | | | | | | Refs: https://github.com/nodejs/remark-preset-lint-node/pull/139 PR-URL: https://github.com/nodejs/node/pull/35454 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: Michael Dawson <midawson@redhat.com>
* doc: sort md references in ASCII orderAntoine du Hamel2020-10-011-3/+3
| | | | | | | | | | | | Refs: https://github.com/nodejs/node/pull/35244 PR-URL: https://github.com/nodejs/node/pull/35191 Fixes: https://github.com/nodejs/node/issues/35189 Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* doc: use .md extension for internal linksAntoine du Hamel2020-10-011-12/+12
| | | | | | | | | | | | | This helps catch broken links as part of the test suite. This also improves the user experience when browsing the markdown files. PR-URL: https://github.com/nodejs/node/pull/35191 Fixes: https://github.com/nodejs/node/issues/35189 Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
* doc: revise introductory child_process textRich Trott2020-09-271-16/+15
| | | | | | | | | This consolidates information about Windows environment variables and has a few other smaller improvements (punctuation, present tense, etc.). PR-URL: https://github.com/nodejs/node/pull/35344 Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* win, child_process: sanitize env variablesBartosz Sosnowski2020-09-241-0/+4
| | | | | | | | | | | | | | | | On Windows environment variables are case-insensitive. When spawning child process certain apps can get confused if some of the variables are duplicated. This adds a step on Windows to normalizeSpawnArguments that removes such duplicates, keeping only the first (in lexicographic order) entry in the env key of options. This is partly already done for the PATH entry. Fixes: https://github.com/nodejs/node/issues/35129 PR-URL: https://github.com/nodejs/node/pull/35210 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
* doc: change type of child_process.signalCode to stringLinn Dahlgren2020-09-241-2/+2
| | | | | | | | | | During testing, and interfacing with child_processes, I found that the child_process.signalCode property to be the string representation of the signal, not number. PR-URL: https://github.com/nodejs/node/pull/35223 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
* doc: use command-line/command line consistentlyRich Trott2020-09-171-3/+3
| | | | | | | | | | | | | | Docs switch between "command line" and "command-line" with no apparent uniformity. Microsoft Style Guide prescribes "command line" as a noun and "command-line" as a modifier, which makes a lot of sense to me. Updating docs as appropriate. PR-URL: https://github.com/nodejs/node/pull/35198 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* doc: reword warnings about sockets passed to subprocessesRich Trott2020-07-111-6/+5
| | | | | | | | | | | | Make the docs more concise. Make warnings direct ("do not use" and "should") rather than "is not recommended" or "is recommended". PR-URL: https://github.com/nodejs/node/pull/34273 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* doc: make minor improvements to paragraph in child_process.mdRich Trott2020-06-281-3/+3
| | | | | | | | | Use shorter and more direct phrasing. PR-URL: https://github.com/nodejs/node/pull/34063 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>