0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 07:27:22 +01:00
Commit Graph

1469 Commits

Author SHA1 Message Date
Alejandro Oviedo
d26927c679 doc: add method links in events.markdown
Added referenced method links.

PR-URL: https://github.com/nodejs/node/pull/3187
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-11-06 16:15:01 +01:00
Shigeki Ohtsu
017fc5b391 doc: add caveats of algs and key size in crypto
Add description of user responsibility in the choice of cypto
algorithms and its key length. Some of recommendations for the safer
use are also described.

PR-URL: https://github.com/nodejs/node/pull/3479
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-05 10:47:28 -08:00
fansworld-claudio
30ce3ebca3 docs: fs - change links to buffer encoding to Buffer class anchor
PR-URL: https://github.com/nodejs/node/pull/2796
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-11-05 09:32:45 -08:00
fansworld-claudio
2e38079ea4 docs: fs - remove encoding list and link to buffer 2015-11-05 09:31:35 -08:00
Ben Noordhuis
dac1d38a02 doc: stdout/stderr can block when directed to file
Update the documentation for `process.stdout` and `process.stdout` to
clarify that writes can block when stdio is redirected to a file.  In
all other cases, it's non-blocking.

PR-URL: https://github.com/nodejs/node/pull/3170
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-11-05 17:27:45 +01:00
David Woods
471aa5a989 doc:fix function param order in assert doc
PR-URL: https://github.com/nodejs/node/pull/3533
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-11-03 13:13:07 -08:00
Guilherme Souza
ac7dd5fc6c doc: add note about timeout delay > TIMEOUT_MAX
When setTimeout() and setInterval() are called with `delay` greater than
TIMEOUT_MAX (2147483647), the supplied value is ignored and 1 is used
instead. Add a note about this in the timers docs.

PR-URL: https://github.com/nodejs/node/pull/3512
Reviewed-By: Trevor Norris <trev.norris@gmai.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2015-11-02 13:38:39 -07:00
Jason Gerfen
9e3aa451a1 doc: fix crypto spkac function descriptions
Fix regarding description of the following functions:

Certificate.exportPublicKey(spkac)
Certificate.exportChallenge(spkac)

The descriptions were applied incorrectly.

PR-URL: https://github.com/nodejs/node/pull/3614
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-11-01 23:57:28 +01:00
Rich Trott
cdcf00a0b9 lib,doc: return boolean from child.send()
The documentation indicates that child.send() returns a boolean but it
has returned undefinined at since v0.12.0. It now returns a boolean per
the (slightly updated) documentation.

PR-URL: https://github.com/nodejs/node/pull/3516
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-10-28 16:21:36 -07:00
Sakthipriyan Vairamani
5d5a4c4c18 doc: createServer's key option can be an array
The `tls` module's `createServer` and `createSecureContext` accept
`key` option and it can be an array of keys as well. This patch
explains the format of the entries in that array.

Corresponding code:
https://github.com/nodejs/node/blob/v4.1.1/lib/_tls_common.js#L73-L90

PR-URL: https://github.com/nodejs/node/pull/3123
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2015-10-28 07:46:27 +05:30
Shigeki Ohtsu
802a2e79e1 tls, crypto: add ALPN Support
ALPN is added to tls according to RFC7301, which supersedes NPN.
When the server receives both NPN and ALPN extensions from the client,
ALPN takes precedence over NPN and the server does not send NPN
extension to the client. alpnProtocol in TLSSocket always returns
false when no selected protocol exists by ALPN.
In https server, http/1.1 token is always set when no
options.ALPNProtocols exists.

PR-URL: https://github.com/nodejs/node/pull/2564
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-10-27 01:31:47 +09:00
Martii
e32aca698e doc: clarify API buffer.concat
* Add a simple example for buffer.concat
* Change grammar slightly.

Fixes: #3219
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3255
2015-10-22 16:20:45 -07:00
Kyle Smith
60a3dd4810 doc: clarify the use of option.detached
This paragraph conveys that detached child processes do not stay
running in the background in general. Instead clarify that this
refers to the parent process exiting before the detached child
process is complete.

Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3250
2015-10-21 12:34:59 -07:00
Domenic Denicola
d381290854 doc: more use-cases for promise events
This adds an example of a semi-common promise pattern that could
result in false-positive 'unhandledRejection' events, to help motivate
why there is a dual 'rejectionHandled' event. I anticipate it being
helpful to users who encounter 'unhandledRejection' events that do not
stem from obvious typos such as the JSON.pasre example.

Also cleans up the promise rejection tracking sample. By using a Map
instead of array we can get O(1) deletion and actually record the errors.
And, fixed indentation and backtick usage there to align with the rest of
the document.

Reviewed-By: Stephan Belanger <admin@stephenbelanger.com>
Reviewed-By: Petka Antonov <petka.antonov@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3438
2015-10-21 10:38:41 -07:00
Yuval Brik
adfd20b6fd tls: TLSSocket options default isServer false
Upon creating a TLSSocket object, set the default isServer option to false
Updated tls docs and added test-tls-socket-default-options

PR-URL: https://github.com/nodejs/node/pull/2614
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-10-20 16:14:22 -04:00
fansworld-claudio
49f965c41c docs: add missing shell option to execSync
Adds the "shell" option from child_process.exec to
child_process.execSync on the api docs.

Fixes: #3387
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/3440
2015-10-20 12:09:35 -07:00
Trevor Norris
57f99a9479 doc: binary encoding is not deprecated
When v8 implemented proper one-byte string support Node's internal
"binary" encoding implementation was removed in favor of it. The result
was that "binary" encoding effectively became "latin-1" encoding.
Because of this and because one-byte strings are natively supported by
v8 the buffer encoding is not deprecated and will not be removed.

Ref: 83261e7 "deps: update v8 to 3.17.13"
PR-URL: https://github.com/nodejs/node/pull/3441
Reviewed-By: Ben Noordhuis <ben@strongloop.com>
2015-10-20 11:46:49 -06:00
Rich Trott
f875c73325 doc: add information about Assert behavior and maintenance
Assert is now locked. Userland alternatives should be used. Assert is
for testing Node.js itself.

Document potentially surprising use of enumerable properties only in
deep equality assertions.

Ref: https://github.com/nodejs/node/pull/3124
Ref: https://github.com/nodejs/node/issues/3122

PR-URL: https://github.com/nodejs/node/pull/3330
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-10-19 11:49:22 -07:00
calebboyd
ff8fa5150f doc: show keylen in pbkdf2 as a byte length
Ensure that keylen for pbkdf2 is documented as a length of bytes and not
bits.

PR-URL: https://github.com/nodejs/node/pull/3334
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2015-10-19 13:45:39 -04:00
Коренберг Марк
d8db75730f tls: add options argument to createSecurePair
Helps in implementation of #6204, where some options passed to
`createSecurePair()` are ignored before this patch.

These options are very helpful if someone wants to pass
`options.servername` or `options.SNICallback` to securepair.

PR-URL: https://github.com/nodejs/node/pull/2441
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-10-17 11:53:45 -04:00
Johannes Wüller
0803962860 fs: add file descriptor support to *File() funcs
These changes affect the following functions and their synchronous
counterparts:

 * fs.readFile()
 * fs.writeFile()
 * fs.appendFile()

If the first parameter is a uint32, it is treated as a file descriptor.
In all other cases, the original implementation is used to ensure
backwards compatibility. File descriptor ownership is never taken from
the user.

The documentation was adjusted to reflect these API changes. A note was
added to make the user aware of file descriptor ownership and the
conditions under which a file descriptor can be used by each of these
functions.

Tests were extended to test for file descriptor parameters under the
conditions noted in the relevant documentation.

PR-URL: https://github.com/nodejs/node/pull/3163
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-10-16 17:14:21 -06:00
Michaël Zasso
8c043c1245 console: rename argument of time and timeEnd
Name it timerName instead of label. It is clearer that way and matches
the description in the doc. It is also how it's named in MDN.

PR-URL: https://github.com/nodejs/node/pull/3166
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-10-16 21:03:44 +02:00
Michaël Zasso
fc72a578e6 doc: reword description of console.time
PR-URL: https://github.com/nodejs/node/pull/3166
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-10-16 21:03:30 +02:00
Michaël Zasso
419f7d4726 console: sub-millisecond accuracy for console.time
This makes the output of console.timeEnd in line with major browsers.

PR-URL: https://github.com/nodejs/node/pull/3166
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-10-16 21:00:51 +02:00
Shigeki Ohtsu
f72e178a78 tls: add minDHSize option to tls.connect()
Add a new option to specifiy a minimum size of an ephemeral DH
parameter to accept a tls connection. Default is 1024 bit.

PR-URL: https://github.com/nodejs/node/pull/1831
Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
2015-10-16 11:39:54 +09:00
Shigeki Ohtsu
6d92ebac11 tls: add TLSSocket.getEphemeralKeyInfo()
Returns an object representing a type, name and size of an ephemeral
key exchange in a client connection. Currently only DHE and ECHE are
supported.

This api only works on on a client connection. When it is called on a
server connection, null is returned. When its key exchange is not
ephemeral, an empty object is returned.

PR-URL: https://github.com/nodejs/node/pull/1831
Reviewed-By: indutny - Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
2015-10-16 11:39:45 +09:00
Roman Reiss
503f279527 doc: fix indent in tls resumption example
Markdown requires 4-space indent to correctly format code blocks. This
fixes the example so it's correctly presented as code.

PR-URL: https://github.com/nodejs/node/pull/3372
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-10-15 11:30:44 +02:00
David Boivin
8e213096df doc: update the assert module summary
The current wording "This module is used for writing unit tests for your
applications, you can access it with require('assert')." implies that
this module should only be used in development while unit testing.

The article "Error Handling in Node.js" by Joyent
(https://www.joyent.com/developers/node/design/errors) uses the assert
module in an efficient way to validate required function arguments.

PR-URL: https://github.com/nodejs/node/pull/2799
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-10-11 19:24:39 +02:00
Roman Klauke
0474bf57d9 doc: replace node-gyp link with nodejs/node-gyp
The node-gyp is now in the nodejs/node-gyp. This commit replaces the
repository owner link with the new nodejs/node-gyp link.

PR-URL: https://github.com/nodejs/node/pull/3320
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-10-11 17:03:30 +02:00
Balázs Galambosi
b9279aa193 doc: remove old note, 'cluster' is marked stable
Fixes: https://github.com/nodejs/node/issues/3313
PR-URL: https://github.com/nodejs/node/pull/3314
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2015-10-10 13:37:15 -07:00
Jason Karns
775c01e3aa doc: recommend Infinity on emitter.setMaxListeners
Instead of recommending `0` as the magic value to set max listeners to
unlimited, recommend `Infinity`. This paves the way for `0` as a magic
value eventually being deprecated and finally removed.

PR-URL: https://github.com/nodejs/node/pull/2559
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-10-09 19:01:29 +02:00
Dave Hodder
048c8f2c4b doc: Amend capitalization of word JavaScript
PR-URL: https://github.com/nodejs/node/pull/3285
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-10-09 18:42:58 +02:00
Alejandro Oviedo
2146f62065 doc: add method links in child_process.markdown
Added links to referenced methods.

PR-URL: https://github.com/nodejs/node/pull/3186
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-10-09 18:41:09 +02:00
Alejandro Oviedo
70c78c9469 doc: add method links in dns.markdown
Added links to referenced methods.

PR-URL: https://github.com/nodejs/node/pull/3196
Reviewed-By: Roman Reiss <me@silverwind.io>>
2015-10-09 18:39:11 +02:00
Roman Reiss
07a84191c0 doc: add TLS session resumption example
Using TLS session resumption correctly is not obvious. This added
example code should help new users understand how to use it correctly.

Related issue: https://github.com/nodejs/node/issues/3132
PR-URL: https://github.com/nodejs/node/pull/3147
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2015-10-07 20:50:47 +02:00
Rod Machen
20b68e5b42 doc: fix spelling in Buffer documentation
Change b.writeUint16LE(0x90ab, 0) to b.writeUInt16LE(0x90ab, 0).

PR-URL: https://github.com/nodejs/node/pull/3226
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2015-10-06 19:09:54 -05:00
Minwoo Jung
d32363ff20 doc: fix outdated 'try/catch' statement in sync
Fixes description about crypto.randomBytes.

Fixes: https://github.com/nodejs/node/issues/3081
PR-URL: https://github.com/nodejs/node/pull/3087
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Brendan Ashworth <brendan.ashworth@me.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-09-30 19:59:10 -07:00
Rich Trott
0e4b772d6c doc: copyedit fs.watch() information
Removed "Only FSEvents supports this type of file watching so it is
unlikely any additional platforms will be added soon."

Per @saghul, "FSEvents" refers to the OSX API, but since we added
Windows support it may not be  unlikely that we add more.

PR-URL: https://github.com/nodejs/node/pull/3097
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-09-29 23:32:23 -07:00
Evan Lucas
30b8bb0aab src: add process.versions.icu
If i18n support is present, add the icu version
to process.versions

Fixes: https://github.com/nodejs/node/issues/3089
PR-URL: https://github.com/nodejs/node/pull/3102
Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-09-29 08:18:03 -05:00
James M Snell
6192c9892f http: add checkIsHttpToken check for header fields
Ref: https://github.com/nodejs/node-convergence-archive/issues/13

This adds a new check for header and trailer fields names and method
names to ensure that they conform to the HTTP token rule. If they do
not, a `TypeError` is thrown.

Previously this had an additional `strictMode` option that has been
removed in favor of making the strict check the default (and only)
behavior.

Doc and test case are included.

On the client-side
```javascript
var http = require('http');
var url = require('url');
var p = url.parse('http://localhost:8888');
p.headers = {'testing 123': 123};
http.client(p, function(res) { }); // throws
```

On the server-side
```javascript
var http = require('http');
var server = http.createServer(function(req,res) {
  res.setHeader('testing 123', 123); // throws
  res.end('...');
});
```

Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Trevor Norris <trevnorris@nodejs.org>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
PR-URL: https://github.com/nodejs/node/pull/2526
2015-09-25 08:37:57 -07:00
Fabio Oliveira
79ebeabd08 docs: Clarify assert.doesNotThrow behavior
The documentation for assert.doesNotThrow now reflects all the inputs
the function accepts, as well as the errors thrown for each combination
of parameter types.

PR-URL: https://github.com/nodejs/node/pull/2807
Reviewed-By: Rich Trott <rtrott@gmail.com>
2015-09-23 15:07:59 -07:00
Laurent Fortin
2d21092400 doc: rearrange execSync and execFileSync
Changed the ordering so it is in line with the async methods.

PR-URL: https://github.com/nodejs/node/pull/2940
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-09-23 22:20:18 +02:00
Laurent Fortin
28da400d47 doc: make execFileSync in line with execFile
PR-URL: https://github.com/nodejs/node/pull/2940
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-09-23 22:19:12 +02:00
reggi
ffdbe9d4f1 doc: fix typos in cluster & errors
PR-URL: https://github.com/nodejs/node/pull/3011
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2015-09-23 22:06:43 +02:00
Sakthipriyan Vairamani
7953c83b85 doc: remove usage of events.EventEmitter
The `events` module already exports `EventEmitter` constructor function
So, we don't have to use `events.EventEmitter` to access it.

Refer: https://github.com/nodejs/node/pull/2896

PR-URL: https://github.com/nodejs/node/pull/2921
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2015-09-23 00:22:11 +05:30
Christopher J. Brody
451acc7559 doc: remove extra using v8::HandleScope statement
v8::HandleScope does not seem to be required for addon functions.

PR-URL: https://github.com/nodejs/node/pull/2983
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-09-21 17:58:11 +02:00
Rich Trott
4fb4c14b61 doc: clarify description of assert.ifError()
This fixes a few typographical errors (comma splices and the like) and
clarifies the description of assert.ifError(). It also standardizes the
document on "inequality" rather than having both "inequality" and "non-
equality".

PR-URL: https://github.com/nodejs/node/pull/2941
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-09-18 23:46:36 -07:00
Rich Trott
4dcf24cfab doc: refine process.kill() and exit explanations
Add corrections about when exit event fires and how .kill() works on
Windows.

PR-URL: https://github.com/nodejs/node/pull/2918
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2015-09-17 15:03:04 -07:00
Rich Trott
43cb1ddb00 doc: process exit event is not guaranteed to fire
This change:

* notes that the exit event is not guaranteed to fire
* provides an example situation where the exit event may not fire
* makes a minor copyediting change
* enforces 80 character wrap in one place where it was not honored

Fixes: https://github.com/nodejs/node/issues/2853
PR-URL: https://github.com/nodejs/node/pull/2861
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-09-16 13:56:48 -07:00
Sam Roberts
6cb9e8a9c4 doc: remove incorrect reference to TCP in net docs
createServer() can create socket of types other than TCP.

PR-URL: https://github.com/nodejs/node/pull/2903
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-09-16 10:52:12 -07:00