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

1604 Commits

Author SHA1 Message Date
Tom Gallacher
a1163582c5 crypto: pbkdf2 deprecate digest overload.
As per #3292, this PR introduces a deprecation notice about removing
the 'default digest' overload which currently defaults to the soon
to be defunct SHA1 digest.

Instead it should be left up to the documentation and implementor to
suggest a suitable digest function.

Ref: https://github.com/nodejs/node/pull/3292
PR-URL: https://github.com/nodejs/node/pull/4047
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
2016-01-23 02:26:28 +09:00
José Moreira
5ef9989bd6 net: add net.listening boolean property over a getter
Added a listening property into net.Server.prototype indicating
if the server is listening or not for connections.

Other Server constructors that rely on net.Server should also
gain access to this property.

Also included tests for net and http subsystems.

PR-URL: https://github.com/nodejs/node/pull/4743
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-01-21 16:34:35 -06:00
Robert Jefe Lindstaedt
e436272897 doc: fenced all code blocks, typo fixes
This changes the code blocks from 4-space indentation to ``` fences for
better syntax highlighting and future linting support. Minor On-the-fly
changes for typos and highlight breaking markdown have been made.

JSON-Style objects have been changed so their closing bracket is
on the same line as the opening one.

Known issues:
* Not every JSON / object notation has been improved. Should
  make another run for this.
* Some example functions break hightlighting due to various
  combinations of brackets. However changing them means leaving
  the code style.

Fixes: https://github.com/nodejs/node/issues/4726
PR-URL: https://github.com/nodejs/node/pull/4733
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-01-21 20:55:09 +01:00
cjihrig
eee9dc7e9d Revert "stream: add bytesRead property for readable"
This reverts commit bfb2cd0bfd.

The bytesRead property, as implemented, tracks characters
instead of bytes when using an identity encoding.

Refs: https://github.com/nodejs/node/pull/4372
PR-URL: https://github.com/nodejs/node/pull/4746
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-01-18 13:13:04 -05:00
Ben Ripkens
5f57005ec9 v8,src: expose statistics about heap spaces
Provide means to inspect information about the separate heap spaces
via a callable API. This is helpful to analyze memory issues.

Fixes: https://github.com/nodejs/node/issues/2079
PR-URL: https://github.com/nodejs/node/pull/4463
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-01-18 11:44:00 -05:00
Evan Lucas
da550aa063 repl: make sure historyPath is trimmed
If one were to set NODE_REPL_HISTORY to a string that contains only a
space (" "), then the history file would be created with that name
which can cause problems are certain systems.

PR-URL: https://github.com/nodejs/node/pull/4539
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2016-01-16 13:21:53 -06:00
cjihrig
212a44df03 doc: clarify protocol default in http.request()
The previously listed default of 'http' is incorrect, and
causes an error to be thrown. This commit changes it to the
correct value of 'http:'

Fixes: https://github.com/nodejs/node/issues/4712
PR-URL: https://github.com/nodejs/node/pull/4714
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-01-15 12:08:49 -05:00
Michael Theriot
666c089e68 doc: fix named anchors in addons.markdown and http.markdown
PR-URL: https://github.com/nodejs/node/pull/4708
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-01-14 22:09:59 -08:00
Jackson Tian
bfb2cd0bfd stream: add bytesRead property for readable
Add a bytesRead property for readable is
useful in some use cases.

When user want know how many bytes read of
readable, need to caculate it in userland.
If encoding is specificed, get the value is
very slowly.

PR-URL: https://github.com/nodejs/node/pull/4372
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-01-14 17:34:29 -08:00
Claudio Rodriguez
310530b7ec doc: add path property to Write/ReadStream in fs.markdown
Documents the "path" property on fs.WriteStream
and fs.ReadStream. See #4327

PR-URL: https://github.com/nodejs/node/pull/4368
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-01-14 17:27:37 -08:00
Vitor Cortez
3470574cb6 doc: clarify explanation of first stream section
The last sentence of the explanation for the first stream section
seemed a bit confusing. I tried to change the sentence to clarify it.

Additionally, the sections were turned into a numbered list to be more
clear about which section is being described, and improve readability.

PR-URL: https://github.com/nodejs/node/pull/4234
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-01-14 17:03:19 -08:00
Roman Klauke
4c132fe61e doc: make references clickable
The child_process docs contained some links, but some links were
somehow "broken". `make doc` couldn't translate them and left `[]`
in the compiled HTML.

PR-URL: https://github.com/nodejs/node/pull/4654
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-01-13 09:08:39 -08:00
Ryan Sobol
d139704ff7 doc: improve child_process.execFile() code example
PR-URL: https://github.com/nodejs/node/pull/4504
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
2016-01-13 11:24:33 -05:00
Daniel Sellers
d755432fa9 http: improves expect header handling
Now returns a 417 error status or allows for an event listener on
the `checkExpectation` event. Before we were ignoring requests that
had misspelled `100-continue` values for expect headers.

This is a quick port of the work done here:
https://github.com/nodejs/node-v0.x-archive/pull/7132 by alFReD-NSH
with surrounding discussion here:
https://github.com/nodejs/node-v0.x-archive/issues/4651

Also updates all the instances of the deprecated
EventEmitter.listenerCount to the current self.listenerCount. Most
of these were in the new code ported over but there was another
legacy instance.

Refs: #2403
PR-URL: https://github.com/nodejs/node/pull/4501
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-01-13 08:05:12 -08:00
zoubin
eeb6fdcd0f doc: add docs for more stream options
PR-URL: https://github.com/nodejs/node/pull/4639
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Chris Dickinson <chris@neversaw.us>
2016-01-12 12:49:42 -08:00
Saquib
6039a7c1b5 fs: add autoClose option to fs.createWriteStream
Add support to fs.createWriteStream and fs.createWriteStream for an autoClose
option that behaves similarly to the autoClose option supported by
fs.createReadStream and fs.ReadStream.

When an instance of fs.createWriteStream created with autoClose === false finishes,
it is not destroyed. Its underlying fd is not closed and it is the
responsibility of the user to close it.

PR-URL: https://github.com/nodejs/node/pull/3679
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-01-11 11:03:52 -08:00
Robert Jefe Lindstaedt
5a53cba784 doc: adds usage of readline line-by-line parsing
In order to make developers aware of node-core built-in
functionality, which might replace module APIs, we should
add an example of readline`s interface usage.
SEO will eventually aid this goal, since it is well searched
on Q&A sites.

PR-URL: https://github.com/nodejs/node/pull/4609
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>>
2016-01-11 19:53:05 +01:00
Richard Sun
a2e77cedef doc: remove "above" and "below" references
The docs were recently refactored, and some "above" and "below"
references were no longer accurate. This commit removes many
such references, and replaces others with links.

PR-URL: https://github.com/nodejs/node/pull/4499
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-01-11 13:06:00 -05:00
Wyatt Preul
d7c5110a79 doc: stronger suggestion for userland assert
Fixes: https://github.com/nodejs/node/issues/4532
PR-URL: https://github.com/nodejs/node/pull/4535
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-01-11 10:17:31 -05:00
Sequoia McDowell
b40aca1cd5 doc: label http.IncomingMessage as a Class
`Server`, `ServerResponse` etc. were marked as classes, this one class
was overlooked.

PR-URL: https://github.com/nodejs/node/pull/4589
Fixes: https://github.com/nodejs/node/issues/4576
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-01-11 07:17:18 +01:00
Sequoia McDowell
9456f5012d doc: document http's server.listen return value
The server method returns `self` in order to allow chaining.

PR-URL: https://github.com/nodejs/node/pull/4590
Fixes: https://github.com/nodejs/node/issues/4571
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-01-11 07:10:01 +01:00
Fedor Indutny
5f76b24e5e http: overridable clientError
Make default `clientError` behavior (close socket immediately)
overridable. With this APIs it is possible to write a custom error
handler, and to send, for example, a 400 HTTP response.

    http.createServer(...).on('clientError', function(err, socket) {
      socket.end('HTTP/1.1 400 Bad Request\r\n\r\n');
      socket.destroy();
    });

Fix: #4543
PR-URL: https://github.com/nodejs/node/pull/4557
Reviewed-By: Brian White <mscdex@mscdex.net>
2016-01-07 03:39:15 -05:00
Fedor Indutny
1ab6b21360 tls: rename clientError to tlsClientError
`clientError` will have `http.Server`-specific behavior, and we don't
want to shadow it in `tls.Server`.

PR-URL: https://github.com/nodejs/node/pull/4557
Reviewed-By: Brian White <mscdex@mscdex.net>
2016-01-07 03:38:56 -05:00
Brian White
e51bbfd487 doc: add missing backtick for readline
PR-URL: https://github.com/nodejs/node/pull/4549
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-01-06 00:04:37 -05:00
James M Snell
cc82e5e3d9 doc: improvements to crypto.markdown copy
General improvements to crypto.markdown including new and
revised examples.

PR-URL: https://github.com/nodejs/node/pull/4435
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
2016-01-06 09:51:56 +09:00
Shigeki Ohtsu
64e294adb2 doc: fix heading level error in Buffer doc
tools/doc/html.js in make doc throws an error in checking a heading
level in the markdown file.

PR-URL: https://github.com/nodejs/node/pull/4537
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-01-05 10:13:21 -08:00
Dave
a497bb5d09 doc: close backtick in process.title description
PR-URL: https://github.com/nodejs/node/pull/4534
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
2016-01-05 10:27:17 -05:00
Richard Sun
5194a1e3ce doc: fix numbering in stream.markdown
PR-URL: https://github.com/nodejs/node/pull/4538
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-01-05 10:24:15 -05:00
James M Snell
7e985d81cc doc: improvements to dgram.markdown copy
General improvements to dgram.markdown copy

PR-URL: https://github.com/nodejs/node/pull/4437
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Reviewed-By: Stephan Belanger <admin@stephenbelanger.com>
2016-01-04 08:42:06 -08:00
James M Snell
bbb4a2a517 doc: improvements to errors.markdown copy
General improvements to errors.markdown including
improved/revised examples

PR-URL: https://github.com/nodejs/node/pull/4454
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
2016-01-04 08:40:09 -08:00
Anna Henningsen
ac153bd2a6 timers: fail early when callback is not a function
`setTimeout()`, `setInterval()` and `setIntermediate` currently
throw errors when receiving non-function objects as their first
argument, but only do so when trying to execute the callback,
i.e. after the waited time has passed. This may complicate
debugging when a lot of calls to `setTimeout()`/etc. are involved,
so failing as early as possible seems like a good idea.

`setTimeout()` historically ignored an falsy first
argument, while the other functions do not and throw instead.
This patch changes this behaviour to make all three match and
adds remarks in the corresponding documentation.

PR-URL: https://github.com/nodejs/node/pull/4362
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
2016-01-04 14:56:19 +11:00
Ryan Sobol
4e8a005662 doc: mention that http.Server inherits from net.Server
PR-URL: https://github.com/nodejs/node/pull/4455
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-12-30 12:06:25 -08:00
Ben Ripkens
c280596944 doc: explain ClientRequest#setTimeout time unit
State a time unit for the timeout parameter in ClientRequest#setTimeout

PR-URL: https://github.com/nodejs/node/pull/4458
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-12-30 12:04:03 -08:00
iamchenxin
1de6e4f9ab doc: add anchors for _transform _flush _writev in stream.markdown
PR-URL: https://github.com/nodejs/node/pull/4448
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-12-30 11:49:47 -08:00
James M Snell
1a004f1187 doc: improvements to debugger.markdown copy
General improvements to debugger.markdown

PR-URL: https://github.com/nodejs/node/pull/4436
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-12-30 11:21:13 -08:00
James M Snell
a0130e16e5 doc: improvements to events.markdown copy
General improvements to events.markdown copy including a
bit of restructuring and improved examples

PR-URL: https://github.com/nodejs/node/pull/4468
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2015-12-30 10:50:52 -08:00
James M Snell
7ee1685d74 doc: improvements to dns.markdown copy
General improvements to dns.markdown copy and examples

PR-URL: https://github.com/nodejs/node/pull/4449
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
2015-12-30 10:48:10 -08:00
James M Snell
e4c835e1cb doc: improvements to console.markdown copy
Several improvements including a few new examples

PR-URL: https://github.com/nodejs/node/pull/4428
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
2015-12-30 10:42:29 -08:00
James M Snell
7d5c1b5b1a doc: improve child_process.markdown copy
General improvements to child_process.markdown

PR-URL: https://github.com/nodejs/node/pull/4383
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-12-30 10:29:48 -08:00
Rich Trott
f241d6685b doc: copyedit setTimeout() documentation
Copyedit the documentation for setTimeout() and enforce wrapping at 80
characters in the markdown file for nearby text.

PR-URL: https://github.com/nodejs/node/pull/4434
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: Stephan Belanger <admin@stephenbelanger.com>
2015-12-29 19:13:13 -08:00
Rich Trott
312b4d6371 doc: fix formatting in process.markdown
All the other properties get an h2/## but process.connected gets an
h3/### for no discernible reason. Change it to h2/## like the others.

PR-URL: https://github.com/nodejs/node/pull/4433
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Stephan Belanger <admin@stephenbelanger.com>
Reviewed-By: Roman Klauke <romaaan.git@gmail.com>
2015-12-29 19:06:23 -08:00
James M Snell
3e648eb2ca doc: improve assert.markdown copy
General improvements to assert.markdown copy including
new and improved examples

PR-URL: https://github.com/nodejs/node/pull/4360
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-12-28 12:14:49 -08:00
Adri Van Houdt
2fd3d8aee6 doc: improve grammar in tls docs
Fix: #4246
PR-URL: https://github.com/nodejs/node/pull/4315
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2015-12-23 17:17:51 -08:00
James M Snell
67b109a4b4 doc: improvements to buffer.markdown copy
General improvements to buffer.markdown including new examples,
a few fixes to existing examples, consistent formatting and
others

PR-URL: https://github.com/nodejs/node/pull/4370
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2015-12-23 13:47:54 -08:00
James M Snell
d5863bc0f4 doc: improve addons.markdown copy
General improvements to the documentation in addons.markdown.

PR-URL: https://github.com/nodejs/node/pull/4320
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-12-23 12:19:42 -08:00
James M Snell
9b21119e17 doc: fix, modernize examples in docs
* Use single quotes consistently
* Modernize examples to use template strings and arrow funcs
* Fix a few typos
* Example edits for consistency

PR-URL: https://github.com/nodejs/node/pull/4282
Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2015-12-17 08:07:29 -08:00
chrisjohn404
f2bddc14f6 doc: Typo in buffer.markdown referencing buf.write()
The buffer's write function is documented below the
buf.toString function and all of the docs reference
"buf" instead of "buffer".

PR-URL: https://github.com/nodejs/node/pull/4324
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-12-17 07:55:09 -08:00
Nicholas Young
4637168f81 doc: fix link in addons.markdown
Update link from github.com/rvagg to github.com/nodejs

PR-URL: https://github.com/nodejs/node/pull/4331
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-12-17 07:48:33 -08:00
Jackson Tian
a8854e5b59 doc: document the cache parameter for fs.realpathSync
PR-URL: https://github.com/nodejs/node/pull/4285
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2015-12-16 08:41:45 -08:00
Jan Schär
9e1b7aa874 doc: document backlog for server.listen() variants
The backlog parameter is supported by all variations of
net.Server.listen(), but wasn't consistently documented. This
commit brings the documentation into a more consistent state.

Refs: https://github.com/nodejs/node/pull/4056
PR-URL: https://github.com/nodejs/node/pull/4025
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
2015-12-16 10:58:51 -05:00