summaryrefslogtreecommitdiff
path: root/doc/api/util.md
AgeCommit message (Collapse)Author
2019-01-182019-01-17, Version 11.7.0 (Current), @BridgeARRuben Bridgewater
Notable Changes * compression / zlib: * Added brotli support (Anna Henningsen and Zach Vacura) https://github.com/nodejs/node/pull/24938 * console: * Added `inspectOptions` option (Ruben Bridgewater) https://github.com/nodejs/node/pull/24978 * crypto: * Always accept private keys as public keys (Tobias Nießen) https://github.com/nodejs/node/pull/25217 * deps: * Upgrade npm to v6.5.0 (Jordan Harband) https://github.com/nodejs/node/pull/25234 * fs: * Use internalBinding('fs') internally instead of process.binding('fs') (Masashi Hirano) https://github.com/nodejs/node/pull/22478 * http(s): * Support overriding http\\s.globalAgent (Roy Sommer) https://github.com/nodejs/node/pull/25170 * util: * Inspect ArrayBuffers contents closely (Ruben Bridgewater) https://github.com/nodejs/node/pull/25006 * worker: * Expose workers by default and remove `--experimental-worker` flag (Anna Henningsen) https://github.com/nodejs/node/pull/25361 PR-URL: https://github.com/nodejs/node/pull/25537
2019-01-10lib: move DEP0029 to end of lifecjihrig
PR-URL: https://github.com/nodejs/node/pull/25377 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-01-10lib: move DEP0028 to end of lifecjihrig
PR-URL: https://github.com/nodejs/node/pull/25377 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-01-10lib: move DEP0027 to end of lifecjihrig
PR-URL: https://github.com/nodejs/node/pull/25377 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-01-10lib: move DEP0026 to end of lifecjihrig
PR-URL: https://github.com/nodejs/node/pull/25377 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2019-01-09util: inspect ArrayBuffers contents as wellRuben Bridgewater
Inspecting an ArrayBuffer now also shows their binary contents. PR-URL: https://github.com/nodejs/node/pull/25006 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-31doc: edit and simplify util.inspect() docscjihrig
PR-URL: https://github.com/nodejs/node/pull/25195 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-12-19util: `format()` now formats bigint and booleansRuben Bridgewater
This is necessary to distinguish them from other data types. PR-URL: https://github.com/nodejs/node/pull/25046 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
2018-12-182018-12-18, Version 11.5.0 (Current)Beth Griggs
Notable changes: * **tls**: * support "BEGIN TRUSTED CERTIFICATE" for ca: (Sam Roberts) [#24733](https://github.com/nodejs/node/pull/24733) * **util**: * add inspection getter option (Ruben Bridgewater) [#24852](https://github.com/nodejs/node/pull/24852) PR-URL: https://github.com/nodejs/node/pull/25102
2018-12-14util: remove todoRuben Bridgewater
Most people are going to use the existing option and switching the name now comes with a cost which does not seem to justify the improvement. PR-URL: https://github.com/nodejs/node/pull/24982 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
2018-12-12util: add inspection getter optionRuben Bridgewater
Currently it is not possible to inspect getters. To prevent any side effects this should not become a default but under lots of circumstances it would still be useful to inspect getters. This way it is possible to actively opt into inspecting those. PR-URL: https://github.com/nodejs/node/pull/24852 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-12-10tools: capitalize sentencesRuben Bridgewater
This adds the `capitalized-comments` eslint rule to verify that actual sentences use capital letters as starting letters. It ignores special words and all lines below 62 characters. PR-URL: https://github.com/nodejs/node/pull/24808 Reviewed-By: Sam Ruby <rubys@intertwingly.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-12-072018-12-07, Version 11.4.0 (Current)Ruben Bridgewater
Notable Changes: * console,util: * `console` functions now handle symbols as defined in the spec. https://github.com/nodejs/node/pull/23708 * The inspection `depth` default is now back at 2. https://github.com/nodejs/node/pull/24326 * dgram,net: * Added ipv6Only option for `net` and `dgram`. https://github.com/nodejs/node/pull/23798 * http: * Chosing between the http parser is now possible per runtime flag. https://github.com/nodejs/node/pull/24739 * readline: * The `readline` module now supports async iterators. https://github.com/nodejs/node/pull/23916 * repl: * The multiline history feature is removed. https://github.com/nodejs/node/pull/24804 * tls: * Added min/max protocol version options. https://github.com/nodejs/node/pull/24405 * The X.509 public key info now includes the RSA bit size and the elliptic curve. https://github.com/nodejs/node/pull/24358 * url: * `pathToFileURL()` now supports LF, CR and TAB. https://github.com/nodejs/node/pull/23720 * Windows: * Tools are not installed using Boxstarter anymore. https://github.com/nodejs/node/pull/24677 * The install-tools scripts or now included in the dist. https://github.com/nodejs/node/pull/24233 * Added new collaborator: * [antsmartian](https://github.com/antsmartian) - Anto Aravinth. https://github.com/nodejs/node/pull/24655 PR-URL: https://github.com/nodejs/node/pull/24854
2018-12-05doc: mention util depth default changeRuben Bridgewater
This was missed when reverting a former commit. To make sure the history is kept in place, this just adds a new entry to state the revert. PR-URL: https://github.com/nodejs/node/pull/24805 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-12-05doc: add internal functionality details of util.inheritsRuben Bridgewater
PR-URL: https://github.com/nodejs/node/pull/24755 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-12-03doc: add missing changes entryRuben Bridgewater
The `util.format()` behavior changed recently. Add the changes entry to document the new BigInt behavior. PR-URL: https://github.com/nodejs/node/pull/24758 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-12-03util,console: handle symbols as defined in the specRuben Bridgewater
The `console` functions rely on the `util.format()` behavior. It did not follow the whatwg spec when it comes to symbols in combination with the %d, %i and %f format specifiers. Using a symbol argument in combination with one of these specifiers resulted in an error instead of returning `'NaN'`. This is now fixed by this patch. PR-URL: https://github.com/nodejs/node/pull/23708 Refs: https://console.spec.whatwg.org/#formatter Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-11-28doc: sort bottom-of-file markdown linksSam Roberts
Reapply https://github.com/nodejs/node/pull/12726 It would be nice to have the sort check applied as part of doc testing, but this change doesn't implement that. PR-URL: https://github.com/nodejs/node/pull/24679 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-11-14Revert "util: change util.inspect depth default"Gus Caplan
This reverts commit ac7450a09a4c167cd43c14d7c88721d22f077529. This fully reverts the changes to util.inspect depth. It has caused breakage in logging to existing apps, and even something as simple as `console.log(require)` will cause >1m freezes. I've heard nothing but negative feedback (seriously not a single person has expressed anything positive about this change) and personally i find this change extremely annoying. PR-URL: https://github.com/nodejs/node/pull/24326 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
2018-10-232018-10-23, Version 11.0.0 (Current)James M Snell
Notable changes: * Build * FreeBSD 10 is no longer supported.[#22617](https://github.com/nodejs/node/pull/22617) * `child_process` * The default value of the `windowsHide` option has been changed to `true`. [#21316](https://github.com/nodejs/node/pull/21316) * `console` * `console.countReset()` will emit a warning if the timer being reset does not exist. [#21649](https://github.com/nodejs/node/pull/21649) * `console.time()` will no longer reset a timer if it already exists. [#20442](https://github.com/nodejs/node/pull/20442) * Dependencies * V8 has been updated to 7.0. [#22754](https://github.com/nodejs/node/pull/22754) * `fs` * The `fs.read()` method now requires a callback. [#22146](https://github.com/nodejs/node/pull/22146) * The previously deprecated `fs.SyncWriteStream` utility has been removed.[#20735](https://github.com/nodejs/node/pull/20735) * `http` * The `http`, `https`, and `tls` modules now use the WHATWG URL parser by default. [#20270](https://github.com/nodejs/node/pull/20270) * General * Use of `process.binding()` has been deprecated. Userland code using `process.binding()` should re-evaluate that use and begin migrating. If there are no supported API alternatives, please open an issue in the Node.js GitHub repository so that a suitable alternative may be discussed. * An experimental implementation of `queueMicrotask()` has been added. [#22951](https://github.com/nodejs/node/pull/22951) * Internal * Windows performance-counter support has been removed. [#22485](https://github.com/nodejs/node/pull/22485) * The `--expose-http2` command-line option has been removed. [#20887](https://github.com/nodejs/node/pull/20887) * Timers * Interval timers will be rescheduled even if previous interval threw an error. [#20002](https://github.com/nodejs/node/pull/20002) * `util` * The WHATWG `TextEncoder` and `TextDecoder` are now globals. [#22281](https://github.com/nodejs/node/pull/22281) * `util.inspect()` output size is limited to 128 MB by default. [#22756](https://github.com/nodejs/node/pull/22756) * A runtime warning will be emitted when `NODE_DEBUG` is set for either `http` or `http2`. [#21914](https://github.com/nodejs/node/pull/21914)
2018-10-17util: treat format arguments equallyRoman Reiss
Two changes here which bring us closer to the console standard: - Arguments to `util.format` are no longer formatted differently depending on their order, with format strings being an exception. - Format specifier formatting is now only triggered if the string actually contains a format string. Under the hood, we now use a single shared function to format the given arguments which will make the code easier to read and modify. PR-URL: https://github.com/nodejs/node/pull/23162 Fixes: https://github.com/nodejs/node/issues/23137 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com>
2018-10-102018-10-10, Version 10.12.0 (Current)Michaël Zasso
Notable changes: * assert * The diff output is now a tiny bit improved by sorting object properties when inspecting the values that are compared with each other. https://github.com/nodejs/node/pull/22788 * cli * The options parser now normalizes `_` to `-` in all multi-word command-line flags, e.g. `--no_warnings` has the same effect as `--no-warnings`. https://github.com/nodejs/node/pull/23020 * Added bash completion for the `node` binary. To generate a bash completion script, run `node --completion-bash`. The output can be saved to a file which can be sourced to enable completion. https://github.com/nodejs/node/pull/20713 * crypto * Added support for PEM-level encryption. https://github.com/nodejs/node/pull/23151 * Added an API asymmetric key pair generation. The new methods `crypto.generateKeyPair` and `crypto.generateKeyPairSync` can be used to generate public and private key pairs. The API supports RSA, DSA and EC and a variety of key encodings (both PEM and DER). https://github.com/nodejs/node/pull/22660 * fs * Added a `recursive` option to `fs.mkdir` and `fs.mkdirSync`. If this option is set to true, non-existing parent folders will be automatically created. https://github.com/nodejs/node/pull/21875 * http2 * Added a `'ping'` event to `Http2Session` that is emitted whenever a non-ack `PING` is received. https://github.com/nodejs/node/pull/23009 * Added support for the `ORIGIN` frame. https://github.com/nodejs/node/pull/22956 * Updated nghttp2 to 1.34.0. This adds RFC 8441 extended connect protocol support to allow use of WebSockets over HTTP/2. https://github.com/nodejs/node/pull/23284 * module * Added `module.createRequireFromPath(filename)`. This new method can be used to create a custom require function that will resolve modules relative to the filename path. https://github.com/nodejs/node/pull/19360 * process * Added a `'multipleResolves'` process event that is emitted whenever a `Promise` is attempted to be resolved multiple times, e.g. if the `resolve` and `reject` functions are both called in a `Promise` executor. https://github.com/nodejs/node/pull/22218 * url * Added `url.fileURLToPath(url)` and `url.pathToFileURL(path)`. These methods can be used to correctly convert between file: URLs and absolute paths. https://github.com/nodejs/node/pull/22506 * util * Added the `sorted` option to `util.inspect()`. If set to `true`, all properties of an object and Set and Map entries will be sorted in the returned string. If set to a function, it is used as a compare function. https://github.com/nodejs/node/pull/22788 * The `util.instpect.custom` symbol is now defined in the global symbol registry as `Symbol.for('nodejs.util.inspect.custom')`. https://github.com/nodejs/node/pull/20857 * Added support for `BigInt` numbers in `util.format()`. https://github.com/nodejs/node/pull/22097 * V8 API * A number of V8 C++ APIs have been marked as deprecated since they have been removed in the upstream repository. Replacement APIs are added where necessary. https://github.com/nodejs/node/pull/23159 * Windows * The Windows msi installer now provides an option to automatically install the tools required to build native modules. https://github.com/nodejs/node/pull/22645 * Workers * Debugging support for Workers using the DevTools protocol has been implemented. https://github.com/nodejs/node/pull/21364 * The public `inspector` module is now enabled in Workers. https://github.com/nodejs/node/pull/22769 * Added new collaborators: * digitalinfinity - Hitesh Kanwathirtha PR-URL: https://github.com/nodejs/node/pull/23313
2018-10-09util: support BigInt in util.formatMasashi Hirano
`util.format` and `console.log` now support BigInt via the existing format specifiers `%i` and `%d`. PR-URL: https://github.com/nodejs/node/pull/22097 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-08doc: add util.inspect() legacy signaturesiddhant
PR-URL: https://github.com/nodejs/node/pull/23216 Fixes: https://github.com/nodejs/node/issues/23205 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-10-02util: change %o depth defaultRuben Bridgewater
Since the default for depth is changed to `20` it is logical to change the %o default as well. It will now always use the default depth. PR-URL: https://github.com/nodejs/node/pull/17907 Refs: https://github.com/nodejs/node/issues/12693 PR-URL: https://github.com/nodejs/node/pull/22846 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
2018-10-02util: change util.inspect depth defaultRuben Bridgewater
The current default is not ideal in most use cases. Therefore it is changed to inspect objects to a maximum depth of 20 in case util.inspect is called with it's defaults. The default is kept at 2 when using console.log() and similar in the repl. PR-URL: https://github.com/nodejs/node/pull/17907 Refs: https://github.com/nodejs/node/issues/12693 PR-URL: https://github.com/nodejs/node/pull/22846 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io>
2018-09-22doc,test: fix inspect's sorted compare functionMichaël Zasso
In V8 7.0, the array sorting algorithm was changed to Timsort, which is stable. A compare function returning only `true` or `false` (converted to 0 and 1) cannot work properly. PR-URL: https://github.com/nodejs/node/pull/22992 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
2018-09-202018-09-20, Version 10.11.0 (Current)Michaël Zasso
Notable changes: * fs * Fixed fsPromises.readdir `withFileTypes`. https://github.com/nodejs/node/pull/22832 * http2 * Added `http2stream.endAfterHeaders` property. https://github.com/nodejs/node/pull/22843 * util * Added `util.types.isBoxedPrimitive(value)`. https://github.com/nodejs/node/pull/22620 * Added new collaborators: * boneskull (https://github.com/boneskull) - Christopher Hiller * The Technical Steering Committee has new members: * apapirovski (https://github.com/apapirovski) - Anatoli Papirovski * gabrielschulhof (https://github.com/gabrielschulhof) - Gabriel Schulhof PR-URL: https://github.com/nodejs/node/pull/22932
2018-09-19util: add order option to `.inspect()`Ruben Bridgewater
The order option can be used to sort the inspected values in case they do not rely on their order as arrays. That way the output is stable no matter of the object property inspection order. PR-URL: https://github.com/nodejs/node/pull/22788 Refs: https://github.com/nodejs/node/issues/22763 Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-09-17util: make TextEncoder/TextDecoder globalJames M Snell
Fixes: https://github.com/nodejs/node/issues/20365 PR-URL: https://github.com/nodejs/node/pull/22281 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2018-09-15util: use a shared symbol for util.inspect.customchocolateboy
Define `util.inspect.custom` as `Symbol.for("nodejs.util.inspect.custom")` rather than `Symbol("util.inspect.custom")`. This allows `inspect` hooks to easily/safely be defined in non-Node.js environments. Fixes: https://github.com/nodejs/node/issues/20821 Refs: https://github.com/nodejs/node/pull/22684 PR-URL: https://github.com/nodejs/node/pull/20857 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
2018-09-13util: limit inspection output size to 128 MBRuben Bridgewater
The maximum hard limit that `util.inspect()` could theoretically handle is the maximum string size. That is ~2 ** 28 on 32 bit systems and ~2 ** 30 on 64 bit systems. Due to the recursive algorithm a complex object could easily exceed that limit without throwing an error right away and therefore crashing the application by exceeding the heap limit. `util.inspect()` is fast enough to compute 128 MB of data below one second on an Intel(R) Core(TM) i7-5600U CPU. This hard limit allows to inspect arbitrary big objects from now on without crashing the application or blocking the event loop significantly. PR-URL: https://github.com/nodejs/node/pull/22756 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
2018-09-05util: add util.types.isBoxedPrimitiveRuben Bridgewater
Checking all boxed primitives individually requires to cross the C++ barrier multiple times besides being more complicated than just a single check. PR-URL: https://github.com/nodejs/node/pull/22620 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-08-29doc: remove redundant 'Example:' and similar notesVse Mozhet Byt
Some nits were also fixed in passing. PR-URL: https://github.com/nodejs/node/pull/22537 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-08-15test: remove harmony flagsRuben Bridgewater
v8 6.8 supports all removed flags. For example for BigInt. PR-URL: https://github.com/nodejs/node/pull/22285 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-07-15doc: declare all parameter typesSam Ruby
PR-URL: https://github.com/nodejs/node/pull/21782 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-07-14doc: prevent some redirectionsVse Mozhet Byt
Replace some redirected URLs with the final ones. PR-URL: https://github.com/nodejs/node/pull/21811 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-07-042018-07-04, Version 10.6.0 (Current)Michaël Zasso
Notable changes: * dns: * An experimental promisified version of the dns module is now available. Give it a try with `require('dns').promises`. [#21264](https://github.com/nodejs/node/pull/21264) * fs: * `fs.lchown` has been undeprecated now that libuv supports it. [#21498](https://github.com/nodejs/node/pull/21498) * lib: * `Atomics.wake` is being renamed to `Atomics.notify` in the ECMAScript specification ([reference](https://github.com/tc39/ecma262/pull/1220)). Since Node.js now has experimental support for worker threads, we are being proactive and added a `notify` alias, while emitting a warning if `wake` is used. [#21413](https://github.com/nodejs/node/pull/21413) [#21518](https://github.com/nodejs/node/pull/21518) * n-api: * Add API for asynchronous functions. [#17887](https://github.com/nodejs/node/pull/17887) * util: * `util.inspect` is now able to return a result instead of throwing when the maximum call stack size is exceeded during inspection. [#20725](https://github.com/nodejs/node/pull/20725) * vm: * Add `script.createCachedData()`. This API replaces the `produceCachedData` option of the `Script` constructor that is now deprecated. [#20300](https://github.com/nodejs/node/pull/20300) * worker: * Support for relative paths has been added to the `Worker` constructor. Paths are interpreted relative to the current working directory. [#21407](https://github.com/nodejs/node/pull/21407) PR-URL: https://github.com/nodejs/node/pull/21629
2018-06-24util: recover from maximum call stack sizeRuben Bridgewater
Using util.inspect should still return values in case the maximum call stack size is reached. This is important to inspect linked lists and similar. PR-URL: https://github.com/nodejs/node/pull/20725 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-06-06doc: simplify deprecation languageRich Trott
Change instances of `foo has been deprecated` to `foo is deprecated` and similar. PR-URL: https://github.com/nodejs/node/pull/21136 Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-05-19util: remove custom inspection functionRuben Bridgewater
This removes the deprecated custom inspection function and fixes all tests accordingly. Refs: https://github.com/nodejs/node/issues/15549 PR-URL: https://github.com/nodejs/node/pull/20722 Refs: https://github.com/nodejs/node/issues/15549 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-11Revert "util: change util.inspect depth default"Anna Henningsen
This reverts commit b994b8eff6018433a56bb10dbc473cefa0dd9370. This caused regressions in ecosystem code. While the change originally was semver-major and could be postponed until after Node.js 10, I think reverting it is a good choice at this point. Also, I personally do not think defaulting to a shallow inspect is a bad thing at all – quite the opposite: It makes `util.inspect()` give an overview of an object, rather than providing a full display of its contents. Changing the `depth` default to infinity fundamentally changed the role that `util.inspect()` plays, and makes output much more verbose and thus at times unusable for `console.log()`-style debugging. PR-URL: https://github.com/nodejs/node/pull/20017 Fixes: https://github.com/nodejs/node/issues/19405 Refs: https://github.com/nodejs/node/pull/17907 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-05-11Revert "util: change %o depth default"Anna Henningsen
This reverts commit 8f153092d86b0605af8a2ef294dc310fefa83e30. PR-URL: https://github.com/nodejs/node/pull/20017 Refs: https://github.com/nodejs/node/pull/17907 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2018-05-10doc: add util.types.isModuleNamespaceObject()Gus Caplan
PR-URL: https://github.com/nodejs/node/pull/20616 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-05-09doc: add util.types.isBig{Int,Uint}64Array()cjihrig
These methods are exposed, even though the BigInt64Array and BigUint64Array types are currently behind the --harmony-bigint command line flag. PR-URL: https://github.com/nodejs/node/pull/20615 Fixes: https://github.com/nodejs/node/issues/20602 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-05-03doc: add more missing backticksVse Mozhet Byt
Also, fix some other nits in passing (formatting, punctuation, typos, redundancy, obsoleteness). PR-URL: https://github.com/nodejs/node/pull/20438 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-02doc: add missing periods or colonsVse Mozhet Byt
Some other formatting nits were fixed and some superfluous descriptions were simplified in passing. PR-URL: https://github.com/nodejs/node/pull/20401 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-04-29doc: remove redundant empty linesVse Mozhet Byt
PR-URL: https://github.com/nodejs/node/pull/20398 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-04-242018-04-24, Version 10.0.0 (Current)James M Snell
* Assert * Calling `assert.fail()` with more than one argument is deprecated. #70dcacd710 * Calling `assert.ok()` with no arguments will now throw. #3cd7977a42 * Calling `assert.ifError()` will now throw with any argument other than `undefined` or `null`. Previously the method would throw with any truthy value. #e65a6e81ef * The `assert.rejects()` and `assert.doesNotReject()` methods have been added for working with async functions. #599337f43e * Async_hooks * Older experimental async_hooks APIs have been removed. #1cc6b993b9 * Buffer * Uses of `new Buffer()` and `Buffer()` outside of the `node_modules` directory will now emit a runtime deprecation warning. #9d4ab90117 * `Buffer.isEncoding()` now returns `undefined` for falsy values, including an empty string. #452eed956e * `Buffer.fill()` will throw if an attempt is made to fill with an empty `Buffer`. #1e802539b2 * Child Process * Undefined properties of env are ignored. #38ee25e2e2, #85739b6c5b * Console * The `console.table()` method has been added. #97ace04492 * Crypto * The `crypto.createCipher()` and `crypto.createDecipher()` methods have been deprecated. Please use `crypto.createCipheriv()` and `crypto.createDecipheriv()` instead. #81f88e30dd * The `decipher.finaltol()` method has been deprecated. #19f3927d92 * The `crypto.DEFAULT_ENCODING` property has been deprecated. #6035beea93 * The `ECDH.convertKey()` method has been added. #f2e02883e7 * The `crypto.fips` property has been deprecated. #6e7992e8b8 * Dependencies * V8 has been updated to 6.6. #9daebb48d6 * OpenSSL has been updated to 1.1.0h. #66cb29e646 * EventEmitter * The `EventEmitter.prototype.off()` method has been added as an alias for `EventEmitter.prototype.removeListener()`. #3bb6f07d52 * File System * The `fs.promises` API provides experimental promisified versions of the `fs` functions. #329fc78e49 * Invalid path errors are now thrown synchronously. #d8f73385e2 * The `fs.readFile()` method now partitions reads to avoid thread pool exhaustion. #67a4ce1c6e * HTTP * Processing of HTTP Status codes `100`, `102-199` has been improved. #baf8495078 * Multi-byte characters in URL paths are now forbidden. #b961d9fd83 * N-API * The n-api is no longer experimental. #cd7d7b15c1 * Net * The `'close'` event will be emitted after `'end'`. #9b7a6914a7 * Perf_hooks * The `PerformanceObserver` class is now an `AsyncResource` and can be monitored using `async_hooks`. #009e41826f * Trace events are now emitted for performance events. #9e509b622b * The `performance` API has been simplified. #2ec6995555 * Performance milestone marks will be emitted as trace events. #96cb4fb795 * Process * Using non-string values for `process.env` is deprecated. #5826fe4e79 * The `process.assert()` method is deprecated. #703e37cf3f * REPL * REPL now experimentally supports top-level await when using the `--experimental-repl-await` flag. #eeab7bc068 * The previously deprecated "magic mode" has been removed. #4893f70d12 * The previously deprecated `NODE_REPL_HISTORY_FILE` environment variable has been removed. #60c9ad7979 * Proxy objects are shown as Proxy objects when inspected. #90a43906ab * Streams * The `'readable'` event is now always deferred with nextTick. #1e0f3315c7 * A new `pipeline()` method has been provided for building end-to-data stream pipelines. #a5cf3feaf1 * Experimental support for async for-await has been added to `stream.Readable`. #61b4d60c5d * Timers * The `enroll()` and `unenroll()` methods have been deprecated. #68783ae0b8 * TLS * The `tls.convertNONProtocols()` method has been deprecated. #9204a0db6e * Support for NPN (next protocol negotiation) has been dropped. #5bfbe5ceae * The `ecdhCurve` default is now `'auto'`. #af78840b19 * Trace Events * A new `trace_events` top-level module allows trace event categories to be enabled/disabld at runtime. #da5d818a54 * URL * The WHATWG URL API is now a global. #312414662b * Util * `util.types.is[…]` type checks have been added. #b20af8088a * Support for bigint formatting has been added to `util.inspect()`. #39dc947409
2018-04-12console: add color supportAnna Henningsen
Add a way to tell `Console` instances to either always use, never use or auto-detect color support and inspect objects accordingly. PR-URL: https://github.com/nodejs/node/pull/19372 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>