0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

3565 Commits

Author SHA1 Message Date
Anna Henningsen
5c6cf30143
src: add environment cleanup hooks
This adds pairs of methods to the `Environment` class and to public APIs
which can add and remove cleanup handlers.

Unlike `AtExit`, this API targets addon developers rather than
embedders, giving them (and Node’s internals) the ability to register
per-`Environment` cleanup work.

We may want to replace `AtExit` with this API at some point.

Many thanks for Stephen Belanger for reviewing the original version of
this commit in the Ayo.js project.

Refs: https://github.com/ayojs/ayo/pull/82
PR-URL: https://github.com/nodejs/node/pull/19377
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-10 14:15:16 +02:00
Ruben Bridgewater
4c6df73ae4
doc: update assert documentation
This adds concrete expected types to the assert documentation.

It also fixes a `changes` entry and improves some minor comments.

PR-URL: https://github.com/nodejs/node/pull/20486
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-10 13:39:17 +02:00
Ruben Bridgewater
cf7be86cd9
assert: accept regular expressions to validate
This makes sure regular expressions on validation objects validate
against strings when used with `assert.throws` and `assert.rejects`.

PR-URL: https://github.com/nodejs/node/pull/20485
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-05-10 13:17:22 +02:00
cjihrig
2246c3c843
doc: add util.types.isBig{Int,Uint}64Array()
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-09 13:57:13 -04:00
Gabriel Schulhof
06dc96fa7c doc: fix missing napi_get_typedarray_info() param
Also, make the type name notation more consistent.

PR-URL: https://github.com/nodejs/node/pull/20631
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-05-09 13:44:50 -04:00
Daniel Bevenius
5c9572d9d1 doc: update VM section text
This commit updates the VM section with suggestion for a minor
improvement (hopefully) of the text.

PR-URL: https://github.com/nodejs/node/pull/20595
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-05-09 10:23:21 +02:00
Ujjwal Sharma
d5b259e22b
doc: add parameters for Http2Stream:error event
Add parameters for the callback for the Http2Stream:error event
inline with the pattern in the rest of the documentation.

Refs: https://github.com/nodejs/help/issues/877#issuecomment-381253464

PR-URL: https://github.com/nodejs/node/pull/20610
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-09 10:14:17 +05:30
Ujjwal Sharma
4214c2fd33
doc: add params for ClientHttp2Session:altsvc
Add parameters for the callback for the ClientHttp2Session:altsvc
event inline with the pattern in the rest of the documentation.

Refs: https://github.com/nodejs/help/issues/877#issuecomment-381253464

PR-URL: https://github.com/nodejs/node/pull/20598
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-09 10:11:18 +05:30
Myles Borins
2c0fc3bd89
2018-05-08, Version 10.1.0 (Current)
Notable Changes:

* console:
  - make console.table() use colored inspect (TSUYUSATO Kitsune)
    https://github.com/nodejs/node/pull/20510
* fs:
  - move fs/promises to fs.promises (cjihrig)
    https://github.com/nodejs/node/pull/20504
* http:
  - added aborted property to request (Robert Nagy)
    https://github.com/nodejs/node/pull/20094
* n-api:
  - initialize a module via a special symbol (Gabriel Schulhof)
    https://github.com/nodejs/node/pull/20161
* src:
  - add public API to expose the main V8 Platform (Allen Yonghuang Wang)
    https://github.com/nodejs/node/pull/20447

PR-URL: https://github.com/nodejs/node/pull/20606
2018-05-08 19:42:16 -07:00
Vse Mozhet Byt
5f2b67dbcd doc, tools: unify stability signatures
PR-URL: https://github.com/nodejs/node/pull/20552
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-05-09 00:52:13 +03:00
Shobhit Chittora
a76dfd24ec doc: refactor mode constants parts in fs.md
1. removed extra mode constants doc.
2. creates bookmark to the common File Access Contants block.

PR-URL: https://github.com/nodejs/node/pull/20558
Fixes: https://github.com/nodejs/node/issues/20049
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-05-09 00:36:13 +03:00
Lambdac0re
cf44abbbfe doc: match console.count()/countReset() signatures
PR-URL: https://github.com/nodejs/node/pull/20599
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-08 18:12:55 +03:00
daGo
2d945fd645 doc: clarify this in event listeners
this === eventEmitter or this === instance of EventEmitter,
but it's this is not EventEmitter.

PR-URL: https://github.com/nodejs/node/pull/20537
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-05-08 13:28:38 +03:00
Chin Huang
852c4592b1 doc: add trace category for fs sync methods
Add the trace category for file system synchronous methods to
documentation so the users can enable it when they want to look
into file system sync method trace data.

PR-URL: https://github.com/nodejs/node/pull/20526
Refs: https://github.com/nodejs/node/pull/19649
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-08 03:23:18 +03:00
cjihrig
975f6c1f70
fs: move fs/promises to fs.promises
PR-URL: https://github.com/nodejs/node/pull/20504
Refs: https://github.com/nodejs/TSC/issues/389
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
2018-05-07 19:47:42 -04:00
Jesse W. Collins
271fdf80f6 doc: excise "periodically" before "emit events"
"periodically" implies regular time intervals between emitted events,
but as first example, "peer connects", implies, the time intervals
may be irregular or unpredictable.

PR-URL: https://github.com/nodejs/node/pull/20581
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-05-07 23:12:55 +03:00
Rich Trott
2f12c95954 doc: edit text about revoking deprecations
* "un-deprecation" ಠ_ಠ -> "revoking deprecations"
* "From time-to-time" -> "Occastionally"
* "semver-major" and "semver-minor" are jargon that readers who don't
  follow our issue tracker will not know. Remove the sentence as it
  doesn't really impact end users. The deprecation is revoked when it is
  revoked. Rules around the releases where deprecations can be revoked
  may be added to the COLLABORATOR_GUIDE in the extensive section about
  deprecations there. If so, great, but let's still remove it here as
  having the information scattered in two places makes it likely that
  one will be edited to contradict the other and then it won't be clear
  which one is correct.
* Remove unneeded italics. The italicized sentence is not hugely
  critical information that we desperately want users to know. Most
  users won't care. They will only care about the deprecation message
  that they are looking up at that moment.

PR-URL: https://github.com/nodejs/node/pull/20519
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 11:16:36 -07:00
Rich Trott
d53f43b368 doc: edit text for DEP0013
* v10.0.0 -> Node.js 10.0.0
* Parenthetical with URL rather than "PR" as a lot of people may not
  know what "PR" stands for but they will know what a URL is. Plus not
  hiding the URL means the text is more copy/paste-able. In this
  particular case, "PR 12562" is not more useful or informative than
  https://github.com/nodejs/node/pull/12562 so just use the URL.

PR-URL: https://github.com/nodejs/node/pull/20519
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 11:16:36 -07:00
Rich Trott
e2c18d5b42 doc: minor edit to DEP0065
Use "Node.js 6.0.0" instead of "Node.js v6.0.0". (We decided to drop "v"
before version numbers to avoid confusion with the V8 JavaScript
engine.)

PR-URL: https://github.com/nodejs/node/pull/20519
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 11:16:36 -07:00
Rich Trott
63a8436b91 doc: fix minor typographical error in DEP0079 text
Change `backwards compatibility` to `backward compatibility`.

(It's confusing because "backwards compatible" is acceptable because
"backwards" can be used as an adverb like that. However, as an
adjective, as in "backward compatibility", only "backward" will do.
Easiest solution: Always use "backward" because it is OK in both cases.
This is all compounded by the US vs UK English thing. US English tends
to favor "backward", and we standardize on US English, so that's another
point in favor of "backward" over "backwards" in this context.)

PR-URL: https://github.com/nodejs/node/pull/20519
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 11:16:36 -07:00
Rich Trott
ef37f09b47 doc: edit text for DEP0082
Make deprecation text more concise and direct.

PR-URL: https://github.com/nodejs/node/pull/20519
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 11:16:36 -07:00
Rich Trott
0b03d91d62 doc: fix text for DEP0085
Fix a typographical error in deprecation text. Convert run-on sentence
to two sentences (one in parentheses).

PR-URL: https://github.com/nodejs/node/pull/20519
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 11:16:36 -07:00
Rich Trott
7a3fc182e6 doc: edit text for DEP0094
Make deprecation text slightly more concise and direct.

PR-URL: https://github.com/nodejs/node/pull/20519
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 11:16:36 -07:00
Rich Trott
118b999a72 doc: edit text for DEP0012
Fix awkward verb tense.

PR-URL: https://github.com/nodejs/node/pull/20519
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 11:16:36 -07:00
Rich Trott
46e6c53de8 doc: edit text for DEP0101
Make the text slightly more concise. Fix awkward verb tense.

PR-URL: https://github.com/nodejs/node/pull/20519
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 11:16:36 -07:00
Rich Trott
395c873158 doc: edit text for DEP0104
Make the deprecation message a bit clear and concise.

PR-URL: https://github.com/nodejs/node/pull/20519
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 11:16:36 -07:00
Ujjwal Sharma
29ccf6e14b
doc: add parameters for Http2Session:stream event
Add parameters for the callback for the Http2Session:stream event
inline with the pattern in the rest of the documentation.

Refs: https://github.com/nodejs/help/issues/877#issuecomment-381253464

PR-URL: https://github.com/nodejs/node/pull/20547
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 23:45:34 +05:30
Ruben Bridgewater
186857f15c
errors: remove ERR_INVALID_ARRAY_LENGTH
This error code is obsolete, since the error message from
ERR_OUT_OF_RANGE is more precise. It was only used a single time,
so I went ahead and replced this.

PR-URL: https://github.com/nodejs/node/pull/20484
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 14:23:29 +02:00
Shobhit Chittora
5efbe4c1e8 doc: update one more command in crypto.md
PR-URL: https://github.com/nodejs/node/pull/20500
Refs: https://github.com/nodejs/node/pull/20400
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-07 04:09:28 +03:00
Shobhit Chittora
a1f342f054
doc: updates crypto doc with openssl list -cipher-algorithms
PR-URL: https://github.com/nodejs/node/pull/20502
Refs: https://github.com/nodejs/node/issues/20385
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
2018-05-06 21:09:33 +02:00
Gabriel Schulhof
4692cf4ebb doc: fix N-API property descriptor documentation
PR-URL: https://github.com/nodejs/node/pull/20433
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-06 12:25:16 -04:00
Daiki Arai
67790962da
https: defines maxHeadersCount in the constructor
In Refs, http.Server's maxHeadersCount field was defined in the
constructor to make hidden class stable and so on. Also in https.Server,
we can use maxHeadersCount the same as http via connectionListener. So,
defines it in the constructor and documentation.

Refs: https://github.com/nodejs/node/pull/9116

PR-URL: https://github.com/nodejs/node/pull/20359
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-05 13:57:07 +02:00
Ayush Gupta
1cf7ef6433 doc: document using domain in REPL
Document that REPL uses the `domain` module to handle uncaught
exceptions, and the side effects caused by it.

PR-URL: https://github.com/nodejs/node/pull/20382
Fixes: https://github.com/nodejs/node/issues/19998
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-04 23:05:56 +03:00
Rich Trott
2d609c5d53 doc: fix mkdtemp() documentation
Several minor fixes to the entries for `mkdtemp()`. The most significant
is that a mistaken use of `fs.mkdtemp()` is corrected to
`fsPromises.mkdtemp()`.

PR-URL: https://github.com/nodejs/node/pull/20512
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
2018-05-04 09:30:29 -07:00
BeniCheni
b4ca3a4dba doc: update examples for fs.access()
PR-URL: https://github.com/nodejs/node/pull/20460
Fixes: https://github.com/nodejs/node/issues/17508
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-04 03:14:35 +03:00
Michael Dawson
4740e5dd8a doc: cleanup n-api.md doc
Partial doc cleanup as per
https://github.com/nodejs/node/issues/20421

PR-URL: https://github.com/nodejs/node/pull/20430
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-03 18:53:10 -04:00
Rich Trott
a00f76c360 doc: synchronize argument names for appendFile()
The documentation used `file` for the first argument to `appendFile()`
functions. However, the code and (more importantly) thrown errors
referred to it as `path`. The latter is especially important because
context is not provided. So you're looking for a function that takes
`path` but that string doesn't appear in your code *or* in the
documentation. It's not until the end user looks at the source code of
Node.js that they can figure out what's going on. This is why it is
important that the names of variables in the documentation match that in
the code. If we want to change this to `file`, then that's OK, but we
need to do it in the source code and error messages too, not just in the
docs. Changing the docs is the smallest change to synchronize everything
so that's what this change does.

PR-URL: https://github.com/nodejs/node/pull/20489
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-03 10:59:11 -07:00
Shobhit Chittora
6a24c0c4d6 doc: update cli flag in crypto.md
PR-URL: https://github.com/nodejs/node/pull/20400
Fixes: https://github.com/nodejs/node/issues/20385
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
2018-05-03 17:46:31 +03:00
Vse Mozhet Byt
2553377d11 doc: add missing periods in documentation.md
PR-URL: https://github.com/nodejs/node/pull/20469
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-05-03 12:13:40 +03:00
Daiki Arai
516349d99c doc: add http.ClientRequest maxHeadersCount
In http.ClientRequest's doc, add maxHeadersCount as a public property.
And in the description of server's one, change a hyphen to a comma.

PR-URL: https://github.com/nodejs/node/pull/20361
Refs: https://github.com/nodejs/node/pull/20359
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-02 22:16:51 -07:00
Vse Mozhet Byt
7588ceaf35 doc: add more missing backticks
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-03 02:12:07 +03:00
Gabriel Schulhof
bdf5be98dd n-api: test and doc napi_throw() of a primitive
Ensure that napi_throw() is able to throw a primitive value, and
document that it is able to throw any JavaScript value.

Fixes: https://github.com/nodejs/abi-stable-node/issues/309
PR-URL: https://github.com/nodejs/node/pull/20428
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-02 09:23:38 -04:00
Vse Mozhet Byt
392d80a617 doc: add missing periods or colons
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-05-02 06:17:08 +03:00
Vse Mozhet Byt
536b1fbd3f doc: mitigate marked bug
PR-URL: https://github.com/nodejs/node/pull/20411
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-02 06:02:42 +03:00
Vse Mozhet Byt
aaca38a261 doc: specify types of listener parameter
We cannot manage with `{any}` because `message` cannot be
of `Symbol` or `undefined` types.

PR-URL: https://github.com/nodejs/node/pull/20405
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-05-02 05:55:23 +03:00
Rich Trott
64a37654ce doc: clarify FileHandle text
There is a paragraph about why the promise-based API uses `FileHandle`
rather than a numeric `fd`. Unfortunately, the paragraph is a bit of
word-salad. Edit it for clarity, grammar, and style.

PR-URL: https://github.com/nodejs/node/pull/20450
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-01 15:48:04 -07:00
Rich Trott
a55c4fdeb1 doc: remove unclear text from fs.write()
There is a paragraph explaining that `fs.write()` cannot write a
substring of the provided string. It's not clear what `buffer` refers
to in that paragraph or even what the purpose of the paragraph is.
There's no suggestion elsewhere that `fs.write()` should be expected to
have a substring feature. Remove the paragraph.

PR-URL: https://github.com/nodejs/node/pull/20450
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-01 15:47:59 -07:00
Rich Trott
f27566f0f2 doc: edit fs.createReadStream() highWaterMark
Shorten the text about the `highWaterMark` value for the stream returned
by `fs.createReadStream()`.

PR-URL: https://github.com/nodejs/node/pull/20450
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-05-01 15:47:40 -07:00
Ayush Gupta
d3abb60b05 doc: remove redundant table of contents for N-API
Since the table of contents is built dynamically when
building the documentation, the additional table of
contents is redundant and an extra overhead to maintain.

PR-URL: https://github.com/nodejs/node/pull/20395
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-04-30 22:04:58 -07:00
Ujjwal Sharma
e954aa0e0c
doc: add parameters for settings events
Add parameters for the callback for the Http2Session:localSettings event
and Http2Session:remoteSettings event inline with the pattern in the
rest of the documentation.

Refs: https://github.com/nodejs/help/issues/877#issuecomment-381253464

PR-URL: https://github.com/nodejs/node/pull/20371
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-05-01 02:32:00 +05:30
Gabriel Schulhof
d3255cad8e n-api: document the look of napi_external values
Describe what JavaScript values of type `napi_external` look like in
JavaScript.

Fixes: https://github.com/nodejs/abi-stable-node/issues/306
PR-URL: https://github.com/nodejs/node/pull/20426
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-04-30 16:29:03 -04:00
Gabriel Schulhof
8062431491 n-api: document that native strings are copied
Mention that a copy is made of the native string by the
napi_create_string_* APIs.

Fixes: https://github.com/nodejs/abi-stable-node/issues/304
PR-URL: https://github.com/nodejs/node/pull/20425
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-04-30 16:25:45 -04:00
Gabriel Schulhof
20eaee5e18 doc: refine napi_get_property_names() doc
Document that only enumerable, string-keyed properties are returned.

Fixes: https://github.com/nodejs/abi-stable-node/issues/307
PR-URL: https://github.com/nodejs/node/pull/20427
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-04-30 14:00:05 -04:00
Ruben Bridgewater
b92c656302
doc: improve process event headers
The headers should be handled as all others as well and just indicate
all arguments.

PR-URL: https://github.com/nodejs/node/pull/20312
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-29 17:10:36 +02:00
Ruben Bridgewater
655430179f
doc: improve assert docs
This improves the error example output by reflecting the current
state. It also makes sure the examples are up to date in general.
`assert.throws` clarified the `ERR_AMBIGUOUS_ARGUMENT` error.

PR-URL: https://github.com/nodejs/node/pull/20313
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-29 17:08:49 +02:00
Hackzzila
564048dc29
http,https,tls: switch to WHATWG URL parser
This switches the url parser from `url.parse()` to the WHATWG URL
parser while keeping `url.parse()` as fallback.

Also add tests for invalid url deprecations and correct hostname
checks.

PR-URL: https://github.com/nodejs/node/pull/20270
Fixes: https://github.com/nodejs/node/issues/19468
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-04-29 17:03:16 +02:00
Vse Mozhet Byt
a3bd06a5e6 doc: remove redundant empty lines
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-29 17:48:43 +03:00
Vse Mozhet Byt
8809f8b40b doc: add missing backticks in n-api.md
Codify types, variable names, and code fragments
checking patterns I've managed to think of.

Some nits were also fixed in passing
(add missing periods, remove extra line breaks etc).

PR-URL: https://github.com/nodejs/node/pull/20390
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-04-29 17:43:51 +03:00
Vse Mozhet Byt
65d97c96aa doc: unify and dedupe returned values in timers.md
PR-URL: https://github.com/nodejs/node/pull/20310
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-04-28 05:13:34 +03:00
Ujjwal Sharma
db10473e57
doc: improve parameters for Http2Session:goaway event
Improve parameters for the callback for the Http2Session:connect event
inline with the pattern in the rest of the documentation.

Refs: https://github.com/nodejs/help/issues/877#issuecomment-381253464
2018-04-28 00:57:01 +05:30
Mark Tiedemann
6c6f31392c
doc: remove superfluous URL require statement
Since v10.0.0, the `URL` class is available on the global object, so
using a `require` statement to access it is no longer necessary.

PR-URL: https://github.com/nodejs/node/pull/20364
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-04-27 20:09:19 +02:00
Daniel Hritzkiv
a1fc52884b doc: fix typo in console.md
logit -> log it

PR-URL: https://github.com/nodejs/node/pull/20349
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-04-27 11:44:10 +03:00
Rich Trott
9c8395679c doc: remove console.table() as inspector-dependent
`console.table()` is implemented in Node.js core and no longer requires
the inspector for use.

PR-URL: https://github.com/nodejs/node/pull/20346
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Jon Moss <me@jonathanmoss.me>
2018-04-26 19:56:05 -07:00
Tobias Nießen
f9b9974f55
crypto: support authTagLength in GCM encryption
The authTagLength option can now be used to produce GCM authentication
tags with a specific length.

PR-URL: https://github.com/nodejs/node/pull/20235
Refs: https://github.com/nodejs/node/pull/20039
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yihong Wang <yh.wang@ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-04-26 20:56:24 +02:00
cjihrig
124875cab2
doc: remove os.uptime() Windows note
The libuv 1.20.2 update in Node 10 aligned the Windows behavior
of os.uptime() with that of other operating systems. The return
value no longer contains a fraction component.

Refs: https://github.com/nodejs/node/pull/20129

PR-URL: https://github.com/nodejs/node/pull/20308
Refs: https://github.com/nodejs/node/pull/20129
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-26 19:54:10 +02:00
Ruben Bridgewater
bda2eaf3d5
doc: fix unhandled to uncaught
PR-URL: https://github.com/nodejs/node/pull/20293
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-04-26 19:53:02 +02:00
Michaël Zasso
2fd248f639
process: migrate methods to throw errors with code
Migrate some methods from node.cc to JS in order to properly throw
errors with codes.

PR-URL: https://github.com/nodejs/node/pull/19973
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-04-26 19:42:55 +02:00
Robert Nagy
d5e363b77e
http: added aborted property to request
PR-URL: https://github.com/nodejs/node/pull/20094
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-04-26 19:38:27 +02:00
Gabriel Schulhof
24c8f0ba8c n-api: update cli documentation
Fixes: https://github.com/nodejs/node/issues/20082
PR-URL: https://github.com/nodejs/node/pull/20301
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-26 11:15:10 -04:00
Ujjwal Sharma
2a30bfe295
doc: improve docs for Http2Session:frameError
Improve documentation regarding the callback parameters for the
frameError event for instances of Http2Session, making it inline with
the currently accepted structure, like the rest of the documentation.

Refs: https://github.com/nodejs/help/issues/877#issuecomment-381253464

PR-URL: https://github.com/nodejs/node/pull/20236
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-04-25 23:09:53 +05:30
Ajido
1e40b75404 doc: add emitter.off() to events.md
PR-URL: https://github.com/nodejs/node/pull/20291
Refs: https://github.com/nodejs/node/pull/17156
Reviewed-By: Colin Ihrig <cjihrig@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-04-25 19:55:53 +03:00
Joyee Cheung
3152b7c0d3
src: assign ERR_SCRIPT_EXECUTION_* codes in C++
Also modifies the error messages so they include more information
and are more consistent.

- The message of ERR_SCRIPT_EXECUTION_INTERRUPTED now mentions
  SIGINT and the trailing period is dropped for consistency.
- Added ERR_SCRIPT_EXECUTION_TIMEOUT and include the timeout
  in the message.

PR-URL: https://github.com/nodejs/node/pull/20147
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-04-25 23:46:08 +08:00
Hackzzila
214fd404b9 doc: fix net.Socket link inconsistencies
PR-URL: https://github.com/nodejs/node/pull/20271
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-04-25 12:18:20 +03:00
James M Snell
0cca27b3ff 2018-04-24, Version 10.0.0 (Current)
* 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-24 12:02:31 -07:00
Gabriel Schulhof
0f8caf23be n-api: initialize a module via a special symbol
Much like regular modules, N-API modules can also benefit from having
a special symbol which they can expose.

Fixes: https://github.com/nodejs/node/issues/19845
PR-URL: https://github.com/nodejs/node/pull/20161
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-04-23 17:24:18 -04:00
Ujjwal Sharma
63cae79a58
doc: add parameters for Http2Session:error event
Add parameters for the callback for the Http2Session:error event
inline with the pattern in the rest of the documentation.

Refs: https://github.com/nodejs/help/issues/877#issuecomment-381253464

PR-URL: https://github.com/nodejs/node/pull/20206
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-23 21:21:51 +05:30
Beni von Cheni
8b012e1464 doc: update trace events categories description
PR-URL: https://github.com/nodejs/node/pull/20092
Fixes: https://github.com/nodejs/node/issues/16315
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-23 09:28:34 +03:00
Tobias Nießen
358d8ffad6
crypto: allow to restrict valid GCM tag length
This change allows users to restrict accepted GCM authentication tag
lengths to a single value.

PR-URL: https://github.com/nodejs/node/pull/20039
Fixes: https://github.com/nodejs/node/issues/17523
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yihong Wang <yh.wang@ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2018-04-23 01:55:09 +02:00
Anatoli Papirovski
647954d0a0
doc: fix incorrect net listen signature
PR-URL: https://github.com/nodejs/node/pull/20209
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-04-22 17:01:01 +02:00
musgravejw
3cb8e64e85 doc: modify net.Server.listen arg list
PR-URL: https://github.com/nodejs/node/pull/20142
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-22 02:25:53 -07:00
Ujjwal Sharma
31cbec7f55
doc,http2: add parameters for Http2Session:connect event
Add parameters for the callback for the Http2Session:connect event
inline with the pattern in the rest of the documentation.

Refs: https://github.com/nodejs/help/issues/877#issuecomment-381253464

PR-URL: https://github.com/nodejs/node/pull/20193
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-04-22 02:39:58 +05:30
Gabriel Schulhof
a71f9baa40 doc: remove "For example" expression in N-API doc
PR-URL: https://github.com/nodejs/node/pull/20187
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-21 10:22:12 -04:00
Mykola Bilochub
d96075c4b6 doc: fix a typo in console documentation
`console.trace()` function prints 'Trace: ', not 'Trace :'.

PR-URL: https://github.com/nodejs/node/pull/20176
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-04-20 22:20:22 +03:00
SheetJS
2652ab3c45 doc: Uint8Array support in Buffer functions
Buffer.from / new Buffer accept Uint8Array

Fixes: https://github.com/nodejs/node/issues/14118

PR-URL: https://github.com/nodejs/node/pull/19949
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2018-04-20 11:07:08 -07:00
Rich Trott
743341d185 doc: wrap buffer.md at 80 characters
Wrap `buffer.md` at 80 characters and enforce with linter.

PR-URL: https://github.com/nodejs/node/pull/19546
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
2018-04-20 10:44:25 -07:00
Rod Vagg
287ec1e8f4 Revert "process: add version constants and compare"
This reverts commit 91e0f8db11.

PR-URL: https://github.com/nodejs/node/pull/20062
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-04-20 10:28:38 -07:00
Indranil Dasgupta
53822f605d doc: add flags section to document all flags
Adds a section at the very end to document all flags and links
to it from every function that takes a flag argument.

Fixes: https://github.com/nodejs/node/issues/16971

PR-URL: https://github.com/nodejs/node/pull/20042
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2018-04-20 08:42:25 -07:00
Rich Trott
76f5b3966b doc: improve buf.write() text in buffer.md
* Use present tense consistently in parameters description.
* Wrap at 80 characters.
* "partial amount of `string`" -> "part of `string`"
* Unnecessary `Buffer.allocUnsafe()` changed to `Buffer.alloc()`.

PR-URL: https://github.com/nodejs/node/pull/20115
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-04-19 20:55:47 -07:00
Ruben Bridgewater
7007eee6a2
assert: validate the block return type
This makes sure the returned value when calling `block` is actually
of type promise in case `assert.rejects` or `assert.doesNotReject`
is called.

PR-URL: https://github.com/nodejs/node/pull/19886
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
2018-04-20 00:21:33 +02:00
Timothy Gu
ceab78f9d8
doc: fully document --experimental-repl-await
PR-URL: https://github.com/nodejs/node/pull/20133
Fixes: https://github.com/nodejs/node/pull/19604#issuecomment-382427090
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-04-18 14:12:39 -07:00
Timothy Gu
be92eab92a
repl: hide top-level await feature behind a flag
PR-URL: https://github.com/nodejs/node/pull/19604
Refs: https://github.com/nodejs/node/pull/17807
Refs: https://github.com/nodejs/node/pull/15566#issuecomment-353428430
Reviewed-By: Gus Caplan <me@gus.host>
2018-04-18 07:50:17 -07:00
Rich Trott
c6b00599f6 doc: adjust slightly awkward wording in buffer.md
Minor re-wording of three sentences to make them slightly more natural.
Ending sentences with prepositions is fine in many cases, but these
three cases are a bit awkward.

PR-URL: https://github.com/nodejs/node/pull/20037
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
2018-04-17 14:43:43 -07:00
Vse Mozhet Byt
c98eeb6b8d doc: update links and names for DevTools Protocol
PR-URL: https://github.com/nodejs/node/pull/20111
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-04-17 20:57:03 +03:00
James M Snell
5c27e44488 trace_events: adds a new trace_events api
Removes the requirement to use `--trace-events-enabled` to enable
trace events. Tracing is enabled automatically if there are any
enabled categories.

Adds a new `trace_events` module with an API for enabling/disabling
trace events at runtime without a command line flag.

```js
const trace_events = require('trace_events');
const categories = [ 'node.perf', 'node.async_hooks' ];
const tracing = trace_events.createTracing({ categories });
tracing.enable();
// do stuff
tracing.disable();
```

Multiple `Tracing` objects may exist and be enabled at any point
in time. The enabled trace event categories is the union of all
enabled `Tracing` objects and the `--trace-event-categories`
flag.

PR-URL: https://github.com/nodejs/node/pull/19803
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
2018-04-17 08:30:20 -07:00
Vse Mozhet Byt
5eb9f3c91c doc: prevent one more false-positive linkification
PR-URL: https://github.com/nodejs/node/pull/20087
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-04-17 04:58:18 +03:00
Vse Mozhet Byt
7dd6d864cb doc: fix suspicious heading emphasis in n-api.md
PR-URL: https://github.com/nodejs/node/pull/20086
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
2018-04-17 04:51:55 +03:00
James M Snell
237aa7e9ae http2: refactor how trailers are done
Rather than an option, introduce a method and an event...

```js
server.on('stream', (stream) => {
  stream.respond(undefined, { waitForTrailers: true });
  stream.on('wantTrailers', () => {
    stream.sendTrailers({ abc: 'xyz'});
  });
  stream.end('hello world');
});
```

This is a breaking change in the API such that the prior
`options.getTrailers` is no longer supported at all.
Ordinarily this would be semver-major and require a
deprecation but the http2 stuff is still experimental.

PR-URL: https://github.com/nodejs/node/pull/19959
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-04-16 09:53:32 -07:00
Vse Mozhet Byt
2e76b175ed doc: fix two sorting nits in fs.md
PR-URL: https://github.com/nodejs/node/pull/20078
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-04-16 19:20:17 +03:00
Mathias Buus
f64bebf205 stream: add pipeline and finished
PR-URL: https://github.com/nodejs/node/pull/19828
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2018-04-16 16:02:12 +02:00
Alec Larson
5cc948b77a fs: add 'close' event to FSWatcher
PR-URL: https://github.com/nodejs/node/pull/19900
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-04-16 14:23:11 +02:00