James M Snell
a4f44acd69
doc: warn about using util.inspect/util.format
...
Because of the potential performance bottlenecks that may be introduced
by `util.inspect()` and `util.format()` in production hot path code.
Based on real user feedback, it is not obvious that these are intended
to be debugging tools.
PR-URL: https://github.com/nodejs/node/pull/17791
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2017-12-21 07:56:18 -08:00
Ruben Bridgewater
439c18578b
util: fix custom inspect description
...
Using a custom inspect function on the inspected object is
deprecated. Remove the reference from the option description
to make sure the user will read about the deprecation in the
more detailed description.
PR-URL: https://github.com/nodejs/node/pull/17576
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-12-21 03:45:34 -03:00
Ruben Bridgewater
c2203cb4dd
util: add util.inspect compact option
...
The current default formatting is not ideal and this improves
the situation by formatting the output more intuitiv.
1) All object keys are now indented by 2 characters instead of
sometimes 2 and sometimes 3 characters.
2) Each object key will now use an individual line instead of
sharing a line potentially with multiple object keys.
3) Long strings will now be split into multiple lines in case
they exceed the "lineBreak" option length (including the
current indentation).
4) Opening braces are now directly behind a object property
instead of using a new line.
5) Switch inspect "base" order. In case the compact option is set
to `false`, inspect will now print
"[Function: foo] {\n property: 'data'\n}"
instead of
"{ [Function: foo]\n property: 'data'\n}".
PR-URL: https://github.com/nodejs/node/pull/17576
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-12-21 03:45:25 -03:00
Ram Goli
3db136a74a
doc: change "Node.js style cb" to "error-first cb"
...
Change the awkward "Node.js style callback" phrasing to the more
informative "error-first callback."
PR-URL: https://github.com/nodejs/node/pull/17638
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Jon Moss <me@jonathanmoss.me >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2017-12-17 13:19:03 -05:00
Tyler
fafd9fbd01
util: allow wildcards in NODE_DEBUG variable
...
PR-URL: https://github.com/nodejs/node/pull/17609
Fixes: https://github.com/nodejs/node/issues/17605
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
2017-12-15 19:31:07 -02:00
Ram Goli
031d01bba5
doc: clearify promisify behavior for bad arguments
...
Currently the documentation states that promisify() will result in
undefined behavior if bad arguments are passed. This is not
necessarily the case, since the behavior is well defined, but just
not useful.
PR-URL: https://github.com/nodejs/node/pull/17593
Fixes: https://github.com/nodejs/node/issues/17569
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Jon Moss <me@jonathanmoss.me >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2017-12-12 16:58:10 -02:00
Gus Caplan
3b9803838c
doc: clarify util.inspect usage intent
...
PR-URL: https://github.com/nodejs/node/pull/17375
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2017-12-12 16:51:59 -02:00
Mithun Sasidharan
817d4adb47
doc: use arrow functions in util.md sample code
...
PR-URL: https://github.com/nodejs/node/pull/17459
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Jon Moss <me@jonathanmoss.me >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2017-12-06 11:16:52 -05:00
Gus Caplan
31e0dbc0c7
util: use @@toStringTag
...
uses @@toStringTag when creating the "tag" for an inspected value
PR-URL: https://github.com/nodejs/node/pull/16956
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Brian White <mscdex@mscdex.net >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-12-01 21:00:33 +01:00
Rich Trott
929f343bb3
doc,test: remove unnecessary await with return instances
...
Remove unnecessary `await` in combination with `return` in preparation
for enabling lint rule.
PR-URL: https://github.com/nodejs/node/pull/17265
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
2017-11-30 23:24:44 -08:00
Leko
e98da3d030
doc: fix typo occuring -> occurring
...
PR-URL: https://github.com/nodejs/node/pull/17350
Reviewed-By: Yosuke Furukawa <yosuke.furukawa@gmail.com >
Reviewed-By: Richard Lau <riclau@uk.ibm.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Jon Moss <me@jonathanmoss.me >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-11-28 02:38:39 +01:00
Leko
53d87b370b
doc: replace function with arrow function
...
PR-URL: https://github.com/nodejs/node/pull/17304
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Ron Korving <ron@ronkorving.nl >
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com >
Reviewed-By: Jon Moss <me@jonathanmoss.me >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-11-26 08:53:29 -08:00
Rich Trott
617e3e96e6
util: runtime deprecation for custom .inspect()
...
Change documentation-only deprecation for custom inspection using
`object.inspect` property to a runtime deprecation.
This is a breaking change. Custom inspection via `object.inspect` is
deprecated because there is a more robust Symbol-based alternative to
`.inspect` and the custom inspection via `object.inspect` feature means
that people can accidentally break `console.log()` simply by attaching a
`.inspect` property to their objects. Note that since this is a
deprecation, the custom inspection will still work. The breaking change
is simply the printing of a warning which could alarm users, break tests
or other things that might be dependent on specific output, etc.
PR-URL: https://github.com/nodejs/node/pull/16393
Ref: https://github.com/nodejs/node/issues/15549
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-11-16 22:00:39 -08:00
Rich Trott
07d39a2262
util: emit deprecation code only once
...
If another function has already emitted the deprecation warning with the
same code as the warning that is about to be emitted, do not emit the
warning.
This is a breaking change. Previously, different functions could emit
the same deprecation warning multiple times. This was a known bug rather
than a feature, but this change is being treated as a breaking change
out of caution. Identical deprecation warnings should not be emitted.
PR-URL: https://github.com/nodejs/node/pull/16393
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-11-16 22:00:24 -08:00
Rich Trott
ccc87ebb33
doc: improve documentation for util.deprecate()
...
Improve documentation for `util.deprecate()`. In particular, provide
complete function signature, document arguments, and document return
value.
PR-URL: https://github.com/nodejs/node/pull/16393
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-11-16 22:00:16 -08:00
Lucas Azzola
7489ee84fe
doc: util.isDeepStrictEqual returns boolean
...
PR-URL: https://github.com/nodejs/node/pull/16653
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
2017-10-31 23:57:51 +01:00
James M Snell
8cd940af13
2017-10-31, Version 9.0.0 (Current)
...
* Older experimental APIs have been removed.
[[`d731369b1d`](https://github.com/nodejs/node/commit/d731369b1d )]
[#14414 ](https://github.com/nodejs/node/pull/14414 )
* **Errors**
* Improvements have been made to `buffer` module error messages.
* The assignment of static error codes to Node.js error continues:
* `buffer`
* `child_process`
* `console`
* `crypto`
* `dns`
* `events`
* `fs`
* `http`
* `inspector`
* `net`
* `path`
* `process`
* `querystring`
* `readline`
* `repl`
* `streams`
* `string_decoder`
* `timers`
* `tls`
* `url`
* `util`
* `v8`
* `zlib`
* **Child Processes**
* Errors are emitted on process nextTick.
* **Domains**
* The long-deprecated `.dispose()` method has been removed.
* **fs**
* The `fs.ReadStream` and `fs.WriteStream` classes now use `destroy()`.
* `fs` module callbacks are now invoked with an undefined context.
* **HTTP/1**
* A 400 Bad Request response will now be sent when parsing fails.
* Socket timeout will be set when the socket connects.
* A bug causing the request `'error'` event to fire twice was fixed.
* HTTP clients may now use generic `Duplex` streams in addition to `net.Socket`.
* **Intl**
* The deprecated `Intl.v8BreakIterator` has been removed.
* **Modules**
* The `require.resolve()` method now supports using custom lookup paths.
* **OS**
* The `os.EOL` property is now read-only.
* **Timers**
* `setTimeout()` will emit a warning if the timeout is larger that the maximum
32-bit unsigned integer.
2017-10-31 12:59:12 -07:00
Rich Trott
36732084db
util,assert: expose util.isDeepStrictEqual()
...
Provide `util.isDeepStrictEqual()` that works like
`assert.deepStrictEqual()` but returns a boolean rather than throwing an
error.
Several userland modules have needed this functionality and implemented
it independently. This functionality already exists in Node.js core, so
this exposes it for use by modules. Modules that have needed this
functionality include `lodash`, `concordance` (used by `ava`), and
`qunit`.
PR-URL: https://github.com/nodejs/node/pull/16084
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2017-10-25 22:30:37 -07:00
James M Snell
7f9eb4c29c
util: graduate TextEncoder/TextDecoder, tests
...
Add tests ported from Web Platform Tests.
Graduate TextEncoder / TextDecoder from experimental
PR-URL: https://github.com/nodejs/node/pull/15743
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
2017-10-23 21:12:56 -07:00
Supamic
9c44215a91
doc: add return value to util.promisify
...
PR-URL: https://github.com/nodejs/node/pull/16040
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2017-10-19 02:26:03 -02:00
Shiya Luo
cc258af0e4
doc: clarify usage of util.promisify.custom
...
PR-URL: https://github.com/nodejs/node/pull/16134
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-10-13 13:41:33 -07:00
Rich Trott
c09c04fc5c
util: deprecate obj.inspect for custom inspection
...
The existence of `obj.inspect()` for custom inspection can cause people
to unintentionally break `console.log()` and friends. This is a
documentation-only deprecation that can hopefully land in 8.x.
PR-URL: https://github.com/nodejs/node/pull/15631
Refs: https://github.com/nodejs/node/issues/15549
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-10-02 00:14:14 -03:00
Chris Young
cacce304cb
doc: add links to alternative versions of doc
...
Each page of the API documentation should have links to other versions
of the same page. This will make it easier to switch between the current
"live" release at nodejs.org and LTS versions.
PR-URL: https://github.com/nodejs/node/pull/10958
Fixes: https://github.com/nodejs/node/issues/10726
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
2017-08-28 11:17:08 +02:00
Anna Henningsen
1fe0741e50
2017-08-15, Version 8.4.0 (Current)
...
Notable changes
* **HTTP2**
* Experimental support for the built-in `http2` has been added via the
`--expose-http2` flag.
[#14239 ](https://github.com/nodejs/node/pull/14239 )
* **Inspector**
* `require()` is available in the inspector console now.
[#8837 ](https://github.com/nodejs/node/pull/8837 )
* Multiple contexts, as created by the `vm` module, are supported now.
[#14465 ](https://github.com/nodejs/node/pull/14465 )
* **N-API**
* New APIs for creating number values have been introduced.
[#14573 ](https://github.com/nodejs/node/pull/14573 )
* **Stream**
* For `Duplex` streams, the high water mark option can now be set
independently for the readable and the writable side.
[#14636 ](https://github.com/nodejs/node/pull/14636 )
* **Util**
* `util.format` now supports the `%o` and `%O` specifiers for printing
objects.
[#14558 ](https://github.com/nodejs/node/pull/14558 )
PR-URL: https://github.com/nodejs/node/pull/14811
2017-08-15 15:05:22 -05:00
Anna Henningsen
314217f8fb
doc: add missing changes: metadata for util
...
Ref: https://github.com/nodejs/node/pull/14558
PR-URL: https://github.com/nodejs/node/pull/14810
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com >
2017-08-13 22:21:03 +02:00
Daijiro Wachi
7294f57c0d
doc: fix docs style in util.md
...
Summary
+ L582: Cell should be padded
+ L589: Cell should be padded
+ L590: Cell should be padded
+ L600: Cell should be padded
+ L622: Cell should be padded
PR-URL: https://github.com/nodejs/node/pull/14711
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
2017-08-13 20:19:12 +02:00
Anna Henningsen
b72e702247
2017-08-09, Version 8.3.0 (Current)
...
V8 6.0:
The V8 engine has been upgraded to version 6.0, which has a significantly
changed performance profile.
[#14574 ](https://github.com/nodejs/node/pull/14574 )
More detailed information on performance differences can be found at
https://medium.com/the-node-js-collection/get-ready-a-new-v8-is-coming-node-js-performance-is-changing-46a63d6da4de
Other notable changes:
* **DNS**
* Independent DNS resolver instances are supported now, with support for
cancelling the corresponding requests.
[#14518 ](https://github.com/nodejs/node/pull/14518 )
* **N-API**
* Multiple N-API functions for error handling have been changed to support
assigning error codes.
[#13988 ](https://github.com/nodejs/node/pull/13988 )
* **REPL**
* Autocompletion support for `require()` has been improved.
[#14409 ](https://github.com/nodejs/node/pull/14409 )
* **Utilities**
* The WHATWG Encoding Standard (`TextDecoder` and `TextEncoder`) has
been implemented as an experimental feature.
[#13644 ](https://github.com/nodejs/node/pull/13644 )
* **Added new collaborators**
* [XadillaX](https://github.com/XadillaX ) – Khaidi Chu
* [gabrielschulhof](https://github.com/gabrielschulhof ) – Gabriel Schulhof
Conflicts:
src/node_version.h
2017-08-09 21:56:19 -04:00
Timothy Gu
365b2e3424
encoding: rudimentary TextDecoder support w/o ICU
...
Also split up the tests.
PR-URL: https://github.com/nodejs/node/pull/14489
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
2017-08-05 16:40:41 +08:00
Greg Alexander
211df3fe8c
util: implement %o and %O as formatting specifiers
...
Implementing the %o and %O formatting specifiers for util.format.
Based on discussion in issue, this specifier should just call
util.inspect to format the value.
PR-URL: https://github.com/nodejs/node/pull/14558
Fixes: https://github.com/nodejs/node/issues/14545
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
2017-08-04 19:30:42 +02:00
Vse Mozhet Byt
9623ce572a
doc: cross-link util.TextDecoder and intl.md
...
Also, note about builds without ICU
and ASCII-sort some bottom references.
PR-URL: https://github.com/nodejs/node/pull/14486
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-07-28 01:18:24 +03:00
James M Snell
ed21cb1774
util: implement WHATWG Encoding Standard API
...
Provide an (initially experimental) implementation of the WHATWG Encoding
Standard API (`TextDecoder` and `TextEncoder`). The is the same API
implemented on the browser side.
By default, with small-icu, only the UTF-8, UTF-16le and UTF-16be decoders
are supported. With full-icu enabled, every encoding other than iso-8859-16
is supported.
This provides a basic test, but does not include the full web platform
tests. Note: many of the web platform tests for this would fail by default
because we ship with small-icu by default.
A process warning will be emitted on first use to indicate that the
API is still experimental. No runtime flag is required to use the
feature.
Refs: https://encoding.spec.whatwg.org/
PR-URL: https://github.com/nodejs/node/pull/13644
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2017-07-24 14:04:13 -07:00
Jeremiah Senkpiel
65eefa0105
2017-07-19, Version 8.2.0 (Current)
...
Big thanks to @addaleax who prepared the vast majority of this release.
Notable changes:
* **Async Hooks**
* Multiple improvements to Promise support in `async_hooks` have been made.
* **Build**
* The compiler version requirement to build Node with GCC has been raised to
GCC 4.9.4.
[[`820b011ed6`](https://github.com/nodejs/node/commit/820b011ed6 )]
[#13466 ](https://github.com/nodejs/node/pull/13466 )
* **Cluster**
* Users now have more fine-grained control over the inspector port used by
individual cluster workers. Previously, cluster workers would simply
increment from the master's debug port.
[[`dfc46e262a`](https://github.com/nodejs/node/commit/dfc46e262a )]
[#14140 ](https://github.com/nodejs/node/pull/14140 )
* **DNS**
* The server used for DNS queries can now use a custom port.
[[`ebe7bb29aa`](https://github.com/nodejs/node/commit/ebe7bb29aa )]
[#13723 ](https://github.com/nodejs/node/pull/13723 )
* Support for `dns.resolveAny()` has been added.
[[`6e30e2558e`](https://github.com/nodejs/node/commit/6e30e2558e )]
[#13137 ](https://github.com/nodejs/node/pull/13137 )
* **npm**
* The `npm` CLI has been updated to version 5.3.0. In particular, it now comes
with the `npx` binary, which is also shipped with Node.
[[`dc3f6b9ac1`](https://github.com/nodejs/node/commit/dc3f6b9ac1 )]
[#14235 ](https://github.com/nodejs/node/pull/14235 )
* `npm` Changelogs:
- [v5.0.4](https://github.com/npm/npm/releases/tag/v5.0.4 )
- [v5.1.0](https://github.com/npm/npm/releases/tag/v5.1.0 )
- [v5.2.0](https://github.com/npm/npm/releases/tag/v5.2.0 )
- [v5.3.0](https://github.com/npm/npm/releases/tag/v5.3.0 )
PR-URL: https://github.com/nodejs/node/pull/13744
2017-07-19 18:40:42 -04:00
Natanael Log
f2149d4ea4
doc, util, console: clarify ambiguous docs
...
Add clarification to the documentation on util.format()
and console.log() regarding how excessive arguments are treated
when the first argument is a non-format string
compared to when it is not a string at all.
PR-URL: https://github.com/nodejs/node/pull/14027
Fixes: https://github.com/nodejs/node/issues/13908
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-07-04 18:53:50 +03:00
Rich Trott
8969c1b762
doc: fix indentation issues in sample code
...
In preparation for stricter ESLint indentation checking, fix a few
issues in sample code.
PR-URL: https://github.com/nodejs/node/pull/13950
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Tobias Nießen <tniessen@tnie.de >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-06-29 15:43:56 -07:00
Refael Ackermann
af3aa682ac
util: add callbackify
...
Add `util.callbackify(function)` for creating callback style functions
from functions returning a `Thenable`
PR-URL: https://github.com/nodejs/node/pull/12712
Fixes: https://github.com/nodejs/CTC/issues/109
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Teddy Katz <teddy.katz@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
2017-06-10 22:49:28 -04:00
Vse Mozhet Byt
ce8bce497c
doc: use prefer-rest-params eslint rule in docs
...
Do not promote using of `arguments`.
One fragment is left as is because of history nature:
it uses a real deprecated code from libs.
Refs: http://eslint.org/docs/rules/prefer-rest-params
Refs: https://github.com/nodejs/node/blob/99da8e8e02a874a0a044889f863c45700509d02c/lib/util.js#L1002-L1006
PR-URL: https://github.com/nodejs/node/pull/13389
Reviewed-By: Daijiro Wachi <daijiro.wachi@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: Refael Ackermann <refack@gmail.com >
2017-06-05 14:27:57 +03:00
Vse Mozhet Byt
862bf1bbc2
doc: modernize and fix code examples in util.md
...
* Remove useless constructor.
* Use template literals.
* Update code example.
Now all arrays with just holes are outputted the same way.
In the fixed example, it was `[ <101 empty items> ]` twice.
PR-URL: https://github.com/nodejs/node/pull/13298
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-06-01 17:45:27 +03:00
James M Snell
43e4efdf21
2017-05-30, Version 8.0.0 (Current)
...
* **Async Hooks**
* The `async_hooks` module has landed in core
[[`4a7233c178`](https://github.com/nodejs/node/commit/4a7233c178 )]
[#12892 ](https://github.com/nodejs/node/pull/12892 ).
* **Buffer**
* Using the `--pending-deprecation` flag will cause Node.js to emit a
deprecation warning when using `new Buffer(num)` or `Buffer(num)`.
[[`d2d32ea5a2`](https://github.com/nodejs/node/commit/d2d32ea5a2 )]
[#11968 ](https://github.com/nodejs/node/pull/11968 ).
* `new Buffer(num)` and `Buffer(num)` will zero-fill new `Buffer` instances
[[`7eb1b4658e`](https://github.com/nodejs/node/commit/7eb1b4658e )]
[#12141 ](https://github.com/nodejs/node/pull/12141 ).
* Many `Buffer` methods now accept `Uint8Array` as input
[[`beca3244e2`](https://github.com/nodejs/node/commit/beca3244e2 )]
[#10236 ](https://github.com/nodejs/node/pull/10236 ).
* **Child Process**
* Argument and kill signal validations have been improved
[[`97a77288ce`](https://github.com/nodejs/node/commit/97a77288ce )]
[#12348 ](https://github.com/nodejs/node/pull/12348 ),
[[`d75fdd96aa`](https://github.com/nodejs/node/commit/d75fdd96aa )]
[#10423 ](https://github.com/nodejs/node/pull/10423 ).
* Child Process methods accept `Uint8Array` as input
[[`627ecee9ed`](https://github.com/nodejs/node/commit/627ecee9ed )]
[#10653 ](https://github.com/nodejs/node/pull/10653 ).
* **Console**
* Error events emitted when using `console` methods are now supressed.
[[`f18e08d820`](https://github.com/nodejs/node/commit/f18e08d820 )]
[#9744 ](https://github.com/nodejs/node/pull/9744 ).
* **Dependencies**
* The npm client has been updated to 5.0.0
[[`3c3b36af0f`](https://github.com/nodejs/node/commit/3c3b36af0f )]
[#12936 ](https://github.com/nodejs/node/pull/12936 ).
* V8 has been updated to 5.8 with forward ABI stability to 6.0
[[`60d1aac8d2`](https://github.com/nodejs/node/commit/60d1aac8d2 )]
[#12784 ](https://github.com/nodejs/node/pull/12784 ).
* **Domains**
* Native `Promise` instances are now `Domain` aware
[[`84dabe8373`](https://github.com/nodejs/node/commit/84dabe8373 )]
[#12489 ](https://github.com/nodejs/node/pull/12489 ).
* **Errors**
* We have started assigning static error codes to errors generated by Node.js.
This has been done through multiple commits and is still a work in
progress.
* **File System**
* The utility class `fs.SyncWriteStream` has been deprecated
[[`7a55e34ef4`](https://github.com/nodejs/node/commit/7a55e34ef4 )]
[#10467 ](https://github.com/nodejs/node/pull/10467 ).
* The deprecated `fs.read()` string interface has been removed
[[`3c2a9361ff`](https://github.com/nodejs/node/commit/3c2a9361ff )]
[#9683 ](https://github.com/nodejs/node/pull/9683 ).
* **HTTP**
* Improved support for userland implemented Agents
[[`90403dd1d0`](https://github.com/nodejs/node/commit/90403dd1d0 )]
[#11567 ](https://github.com/nodejs/node/pull/11567 ).
* Outgoing Cookie headers are concatenated into a single string
[[`d3480776c7`](https://github.com/nodejs/node/commit/d3480776c7 )]
[#11259 ](https://github.com/nodejs/node/pull/11259 ).
* The `httpResponse.writeHeader()` method has been deprecated
[[`fb71ba4921`](https://github.com/nodejs/node/commit/fb71ba4921 )]
[#11355 ](https://github.com/nodejs/node/pull/11355 ).
* New methods for accessing HTTP headers have been added to `OutgoingMessage`
[[`3e6f1032a4`](https://github.com/nodejs/node/commit/3e6f1032a4 )]
[#10805 ](https://github.com/nodejs/node/pull/10805 ).
* **Lib**
* All deprecation messages have been assigned static identifiers
[[`5de3cf099c`](https://github.com/nodejs/node/commit/5de3cf099c )]
[#10116 ](https://github.com/nodejs/node/pull/10116 ).
* The legacy `linkedlist` module has been removed
[[`84a23391f6`](https://github.com/nodejs/node/commit/84a23391f6 )]
[#12113 ](https://github.com/nodejs/node/pull/12113 ).
* **N-API**
* Experimental support for the new N-API API has been added
[[`56e881d0b0`](https://github.com/nodejs/node/commit/56e881d0b0 )]
[#11975 ](https://github.com/nodejs/node/pull/11975 ).
* **Process**
* Process warning output can be redirected to a file using the
`--redirect-warnings` command-line argument
[[`03e89b3ff2`](https://github.com/nodejs/node/commit/03e89b3ff2 )]
[#10116 ](https://github.com/nodejs/node/pull/10116 ).
* Process warnings may now include additional detail
[[`dd20e68b0f`](https://github.com/nodejs/node/commit/dd20e68b0f )]
[#12725 ](https://github.com/nodejs/node/pull/12725 ).
* **REPL**
* REPL magic mode has been deprecated
[[`3f27f02da0`](https://github.com/nodejs/node/commit/3f27f02da0 )]
[#11599 ](https://github.com/nodejs/node/pull/11599 ).
* **Src**
* `NODE_MODULE_VERSION` has been updated to 57
(https://github.com/nodejs/node/commit/ec7cbaf266 )]
[#12995 ](https://github.com/nodejs/node/pull/12995 ).
* Add `--pending-deprecation` command-line argument and
`NODE_PENDING_DEPRECATION` environment variable
[[`a16b570f8c`](https://github.com/nodejs/node/commit/a16b570f8c )]
[#11968 ](https://github.com/nodejs/node/pull/11968 ).
* The `--debug` command-line argument has been deprecated. Note that
using `--debug` will enable the *new* Inspector-based debug protocol
as the legacy Debugger protocol previously used by Node.js has been
removed. [[`010f864426`](https://github.com/nodejs/node/commit/010f864426 )]
[#12949 ](https://github.com/nodejs/node/pull/12949 ).
* Throw when the `-c` and `-e` command-line arguments are used at the same
time [[`a5f91ab230`](https://github.com/nodejs/node/commit/a5f91ab230 )]
[#11689 ](https://github.com/nodejs/node/pull/11689 ).
* Throw when the `--use-bundled-ca` and `--use-openssl-ca` command-line
arguments are used at the same time.
[[`8a7db9d4b5`](https://github.com/nodejs/node/commit/8a7db9d4b5 )]
[#12087 ](https://github.com/nodejs/node/pull/12087 ).
* **Stream**
* `Stream` now supports `destroy()` and `_destroy()` APIs
[[`b6e1d22fa6`](https://github.com/nodejs/node/commit/b6e1d22fa6 )]
[#12925 ](https://github.com/nodejs/node/pull/12925 ).
* `Stream` now supports the `_final()` API
[[`07c7f198db`](https://github.com/nodejs/node/commit/07c7f198db )]
[#12828 ](https://github.com/nodejs/node/pull/12828 ).
* **TLS**
* The `rejectUnauthorized` option now defaults to `true`
[[`348cc80a3c`](https://github.com/nodejs/node/commit/348cc80a3c )]
[#5923 ](https://github.com/nodejs/node/pull/5923 ).
* The `tls.createSecurePair()` API now emits a runtime deprecation
[[`a2ae08999b`](https://github.com/nodejs/node/commit/a2ae08999b )]
[#11349 ](https://github.com/nodejs/node/pull/11349 ).
* A runtime deprecation will now be emitted when `dhparam` is less than
2048 bits [[`d523eb9c40`](https://github.com/nodejs/node/commit/d523eb9c40 )]
[#11447 ](https://github.com/nodejs/node/pull/11447 ).
* **URL**
* The WHATWG URL implementation is now a fully-supported Node.js API
[[`d080ead0f9`](https://github.com/nodejs/node/commit/d080ead0f9 )]
[#12710 ](https://github.com/nodejs/node/pull/12710 ).
* **Util**
* `Symbol` keys are now displayed by default when using `util.inspect()`
[[`5bfd13b81e`](https://github.com/nodejs/node/commit/5bfd13b81e )]
[#9726 ](https://github.com/nodejs/node/pull/9726 ).
* `toJSON` errors will be thrown when formatting `%j`
[[`455e6f1dd8`](https://github.com/nodejs/node/commit/455e6f1dd8 )]
[#11708 ](https://github.com/nodejs/node/pull/11708 ).
* Convert `inspect.styles` and `inspect.colors` to prototype-less objects
[[`aab0d202f8`](https://github.com/nodejs/node/commit/aab0d202f8 )]
[#11624 ](https://github.com/nodejs/node/pull/11624 ).
* The new `util.promisify()` API has been added
[[`99da8e8e02`](https://github.com/nodejs/node/commit/99da8e8e02 )]
[#12442 ](https://github.com/nodejs/node/pull/12442 ).
* **Zlib**
* Support `Uint8Array` in Zlib convenience methods
[[`91383e47fd`](https://github.com/nodejs/node/commit/91383e47fd )]
[#12001 ](https://github.com/nodejs/node/pull/12001 ).
* Zlib errors now use `RangeError` and `TypeError` consistently
[[`b514bd231e`](https://github.com/nodejs/node/commit/b514bd231e )]
[#11391 ](https://github.com/nodejs/node/pull/11391 ).
2017-05-30 10:58:31 -07:00
Michael Dawson
5b50501395
doc: make spelling of behavior consistent
...
In the api docs there were some instances of behaviour
and many more with behavior. I was asked as part of a review
on a different PR which one to use and went with behavior
to be consistent with the majority.
Our style guide states that American English spelling is preferred.
PR-URL: https://github.com/nodejs/node/pull/13245
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Kunal Pathak <kunal.pathak@microsoft.com >
2017-05-28 10:54:10 +02:00
Alexey Orlenko
2af49b6c89
doc: make the style of notes consistent
...
Make the style of "Note:" paragraphs consistent and document the
guidelines in `doc/STYLE_GUIDE.md`.
PR-URL: https://github.com/nodejs/node/pull/13133
Fixes: https://github.com/nodejs/node/issues/13131
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com >
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
2017-05-25 18:49:41 -04:00
Anna Henningsen
99da8e8e02
util: add util.promisify()
...
Add `util.promisify(function)` for creating promisified functions.
Includes documentation and tests.
Fixes: https://github.com/nodejs/CTC/issues/12
PR-URL: https://github.com/nodejs/node/pull/12442
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Myles Borins <myles.borins@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: William Kapke <william.kapke@gmail.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Teddy Katz <teddy.katz@gmail.com >
2017-05-09 15:01:41 +02:00
Sam Roberts
ea1b8a5cbc
doc: sort bottom-of-file markdown links
...
PR-URL: https://github.com/nodejs/node/pull/12726
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
2017-05-08 09:30:55 -07:00
Rich Trott
a180259e42
test,lib,doc: use function declarations
...
Replace function expressions with function declarations in preparation
for a lint rule requiring function declarations.
PR-URL: https://github.com/nodejs/node/pull/12711
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
2017-05-01 15:56:58 -07:00
Vse Mozhet Byt
6ee6aaefa1
doc: add no-var, prefer-const in doc eslintrc
...
PR-URL: https://github.com/nodejs/node/pull/12563
Refs: https://github.com/nodejs/node/pull/12557#issuecomment-296015032
Reviewed-By: Teddy Katz <teddy.katz@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
2017-04-25 00:06:39 +03:00
Vse Mozhet Byt
e2c3e4727d
doc: conform to rules for eslint-plugin-markdown
...
PR-URL: https://github.com/nodejs/node/pull/12563
Refs: https://github.com/nodejs/node/pull/12557#issuecomment-296015032
Reviewed-By: Teddy Katz <teddy.katz@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com >
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com >
2017-04-25 00:06:00 +03:00
Tarun Batra
78af0df25e
doc: add single arg scenario for util.format
...
Set the expected outcome of `util.format('%%')` to be `%%`
instead of `%`.
PR-URL: https://github.com/nodejs/node/pull/12374
Fixes: https://github.com/nodejs/node/issues/12362
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: Rich Trott <rtrott@gmail.com >
Reviewed-By: Refael Ackermann <refack@gmail.com >
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com >
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com >
Reviewed-By: Evan Lucas <evanlucas@me.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
2017-04-13 17:46:55 +03:00
Roman Reiss
a46c43d21a
util: add %i and %f formatting specifiers
...
This change brings formatting specifiers available in `util.format` and
consequently, `console.*` closer to what is supported in all major
browsers.
- `%i` is introduced to format integer values.
- `%f` is introduced to format floating point values.
Fixes: https://github.com/nodejs/node/issues/10292
PR-URL: https://github.com/nodejs/node/pull/10308
Reviewed-By: James M Snell <jasnell@gmail.com >
2017-03-29 07:12:05 +02:00
Roman Reiss
ff1361957d
doc: consistent case for primitive types
...
PR-URL: https://github.com/nodejs/node/pull/11167
Reviewed-By: Timothy Gu <timothygu99@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
2017-03-02 17:55:45 +01:00
Anna Henningsen
2426aaf11c
doc: add changelogs for util
...
PR-URL: https://github.com/nodejs/node/pull/11489
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Italo A. Casas <me@italoacasas.com >
2017-02-24 02:06:31 +01:00
Vse Mozhet Byt
52b253677a
doc: fix sorting in API references
...
PR-URL: https://github.com/nodejs/node/pull/11331
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Sam Roberts <vieuxtech@gmail.com >
2017-02-20 13:11:11 -08:00