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

2035 Commits

Author SHA1 Message Date
Luigi Pinca
769f63ccd8 doc: add added: information for events
PR-URL: https://github.com/nodejs/node/pull/7822
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2016-08-05 14:43:09 -07:00
Phillip Johnsen
66af6a9028
doc: improve server.listen() random port
Minor rewording related to making a server listen to a random port,
and added how to retrieve which port was randomly chosen by the OS.

Also changed documented `server.listen()` signature as it does in fact
not require `port` to be provided.

PR-URL: https://github.com/nodejs/node/pull/7976
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-08-05 23:31:07 +02:00
Anna Henningsen
c809b88345
doc: use blockquotes for Stability: markers
Use blockquotes instead of code blocks for stability markers in
the docs. Doing that:

- Makes the makers appear correctly when viewed e.g. on github.
- Allows remark-lint rules like `no-undefined-references` to work
  properly (https://github.com/nodejs/node/pull/7729).

PR-URL: https://github.com/nodejs/node/pull/7757
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-08-04 22:43:34 +02:00
hugnosis
561958e565 doc: fix default encoding mention in crypto.md
The default encoding for crypto methods was changed in v6.0.0
with v4.x keeping a default of binary.

PR-URL: https://github.com/nodejs/node/pull/7805
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-04 13:15:16 -07:00
vladimir
320f433dcd util: support classes in util.deprecate()
Classes cannot be instantiated without new, but util.deprecate()
uses Function.prototype.apply(). This commit uses new.target to
detect constructor calls, allowing classes to be deprecated.

PR-URL: https://github.com/nodejs/node/pull/7690
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-04 11:44:40 -04:00
James M Snell
29e49fc286 doc, punycode: soft-deprecation of the punycode module
As discussed and agreed upon by the CTC, the punycode module bundled
in core is soft-deprecated (docs only) for v7 with an eye towards
hard-deprecation in v8 or later.

Also see discussion in https://github.com/nodejs/node/pull/7552

PR-URL: https://github.com/nodejs/node/pull/7941
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
2016-08-03 10:03:37 -07:00
cjihrig
75c6d9dd95 cluster: support stdio option for workers
This commit allows setupMaster() to configure the stdio channels
for worker processes.

Refs: https://github.com/nodejs/node-v0.x-archive/issues/5727
Refs: https://github.com/nodejs/node/pull/7811
PR-URL: https://github.com/nodejs/node/pull/7838
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-01 15:08:42 -04:00
Joey Cozza
65a42ab892 doc: fix path markdown formatting
Single quotes in two of the examples were throwing off the
formatting of the path documentation on the Node.js website. This
commit expands two contractions to remove the offending quotes.

PR-URL: https://github.com/nodejs/node/pull/7817
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-01 11:21:17 -04:00
Ravindra barthwal
1658297f47 doc: add missing semicolon
PR-URL: https://github.com/nodejs/node/pull/7915
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-08-01 09:14:28 -04:00
Eugene Ostroukhov
f789eb3106 inspector: Do not crash if the port is n/a
Node process will no longer terminate with an assertion if the
inspector port is not available.

PR-URL: https://github.com/nodejs/node/pull/7874
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
2016-07-29 10:59:32 -07:00
Joe Esposito
6ea8c669df doc: remove extra spaces and concats in examples
PR-URL: https://github.com/nodejs/node/pull/7885
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-07-29 09:12:17 -07:00
Prince J Wesley
c948877688
doc: align breakEvalOnSigint - repl option
PR-URL: https://github.com/nodejs/node/pull/7849
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: JungMinu - Minwoo Jung <jmwsoft@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-07-28 08:56:20 +05:30
Alex Perkins
1d83013d19
doc: minor typo fixes in stream docs
PR-URL: https://github.com/nodejs/node/pull/7763
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2016-07-27 13:42:58 +02:00
Anna Henningsen
c67ec57c8f
doc: fix added: date for NODE_REPL_HISTORY
`NODE_REPL_HISTORY` was introduced in v3.0.0
(see e.g. 6faf17cb45).

PR-URL: https://github.com/nodejs/node/pull/7775
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-07-25 10:01:32 +02:00
Brian White
b3127df59a
doc: add/fix version metadata for Buffer methods
PR-URL: https://github.com/nodejs/node/pull/7784
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-07-22 17:42:28 -04:00
Brian White
ac57089960
doc: improve function parameter descriptions
PR-URL: https://github.com/nodejs/node/pull/7784
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-07-22 17:42:24 -04:00
Brian White
3f208c70da
doc: add missing properties in Buffer docs
PR-URL: https://github.com/nodejs/node/pull/7784
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-07-22 17:42:21 -04:00
Brian White
87a097da51
doc: improve wording and style of Buffer docs
PR-URL: https://github.com/nodejs/node/pull/7784
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-07-22 17:42:18 -04:00
Brian White
cc1318b5ed
doc: improve links in Buffer docs
This commit adds more links and reuses existing link references more.

PR-URL: https://github.com/nodejs/node/pull/7784
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-07-22 17:42:13 -04:00
Brian White
344cac112b
doc: reorganize Buffer link references
This commit adds more links and separates internal doc links
from external web links.

PR-URL: https://github.com/nodejs/node/pull/7784
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-07-22 17:42:09 -04:00
Brian White
fe89848dc6
doc: improve Buffer code examples
PR-URL: https://github.com/nodejs/node/pull/7784
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
2016-07-22 17:41:14 -04:00
cjihrig
ff3ce11894 child_process: support stdio option in fork()
This commit allows child_process.fork() to pass stdio options
to spawn(). This allows fork() to more easily take advantage of
additional stdio channels.

Refs: https://github.com/nodejs/node-v0.x-archive/issues/5727
PR-URL: https://github.com/nodejs/node/pull/7811
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
2016-07-22 11:57:01 -04:00
Vitaly Tomilov
74f0943284
doc: correcting misspelling
Changing `stringp` to `string`.

PR-URL: https://github.com/nodejs/node/pull/7797
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Minwoo Jung <jmwsoft@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2016-07-20 17:55:37 +02:00
Sakthipriyan Vairamani
af4915894b doc: general improvments to events documentation
PR-URL: https://github.com/nodejs/node/pull/7480
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-07-20 10:11:19 +05:30
Hargobind S. Khalsa
59741a9bee doc: correct sample output of buf.compare
Comparing the buffers `ABC` and `ABCD` returns `-1` not `1`.

PR-URL: https://github.com/nodejs/node/pull/7777
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-07-18 10:35:59 -04:00
Italo A. Casas
c897d0ba71
doc: add added: information for stream
Ref: https://github.com/nodejs/node/issues/6578
PR-URL: https://github.com/nodejs/node/pull/7287
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
2016-07-17 23:20:46 +02:00
saadq
28d9485c25 doc: fix inconsistencies in code style
Adds missing semicolons, removes extra white space, and properly indents
various code snippets in the documentation.

Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: targos - Michaël Zasso <mic.besace@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/7745
2016-07-15 13:51:58 -04:00
Lance Ball
2fe277a05c doc: Warn against uncaughtException dependency.
State in the documentation that `uncaughtException` is not a reliable
way to restart a crashed application, and clarify that an application
may crash in ways that do not trigger this event.

Use a documented synchronous function in example code.

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

Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/6378
2016-07-15 11:09:46 -04:00
Kevin Donahue
c09dfe3a0b
doc: fix typo in stream doc
Fix small typo in Buffering section of stream doc.
PR-URL: https://github.com/nodejs/node/pull/7738
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-07-15 16:56:02 +02:00
Claudio Rodriguez
6e15ae98fe fs: rename event to eventType in fs.watch listener
The name 'event' for the argument of the listener in
fs.watch was confusing considering FSWatcher also had
events. This changes the name of the argument to
eventType.

Fixes: https://github.com/nodejs/node/issues/7504
PR-URL: https://github.com/nodejs/node/pull/7506
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2016-07-14 19:24:48 +01:00
Сковорода Никита Андреевич
a58b48bc3b doc: various documentation formatting fixes
* Fix markdown code sample in releases.md, it was <a id="x.y.x></a>"
* Fix some markdown errors, e.g. in changelogs
* Fix broken defs links, e.g. in domain-postmortem.md
* Fix other broken refs, by addaleax
* Add links to some defs that were present but not linked to
* Remove dead defs
* Move defs to the bottom (one file affected)
* Add language indicators to all code blocks, using `txt` when no
specific language could be chosen
* Some minor formatting changes (spaces, ident, headings)

PR-URL: https://github.com/nodejs/node/pull/7637
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-07-14 12:26:50 +03:00
Anna Henningsen
a7105a8db3
test,doc: clarify buf.indexOf(num) input range
Hopefully clarify the behaviour of `buffer.indexOf()` and
`buffer.includes()` for numbers in that they will be
truncated to uint8s.

Add tests for that behaviour.

Fixes: https://github.com/nodejs/node/issues/7591
PR-URL: https://github.com/nodejs/node/pull/7611
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2016-07-13 21:03:42 +02:00
Evan Lucas
bc7b71937c doc: fix util.deprecate() example
The arguments object is not created for arrow functions so the example
was incorrect.

PR-URL: https://github.com/nodejs/node/pull/7674
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-07-13 07:47:07 -05:00
Sakthipriyan Vairamani
4b9a0e4133 doc: link and highlight Object.assign
PR-URL: https://github.com/nodejs/node/pull/7670
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-07-13 07:12:33 +05:30
Quentin Headen
fcae5e2d91
doc: dns.resolve fix callback argument description
The dns.resolve documentation stated that an array of IP
addresses would be returned in the callback. This is true
for everything other than the SOA record which returns an object.
This fixes that documentation.

Fixes: https://github.com/nodejs/node/issues/6506
PR-URL: https://github.com/nodejs/node/pull/7532
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-07-11 19:59:56 +02:00
Santiago Gimeno
5a641e2b6d doc,dgram: fix addMembership documentation
Adding membership using `IP_ADD_MEMBERSHIP` with interface address set
to `INADDR_ANY` for `IPv4` or as an index of `0` for `IPv6` leads to
using only one interface selected by the operating system.

Fixes: https://github.com/nodejs/node/issues/1692
PR-URL: https://github.com/nodejs/node/pull/7244
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-07-10 17:56:50 +02:00
Diosney Sarmiento
9fbe456db1 repl: add support for custom completions
Allow user code to override the default `complete()` function from
`readline.Interface`. See:
https://nodejs.org/api/readline.html#readline_use_of_the_completer_function

Ref: https://github.com/nodejs/node-v0.x-archive/pull/8484

PR-URL: https://github.com/nodejs/node/pull/7527
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Lance Ball <lball@redhat.com>
2016-07-08 16:47:05 -04:00
Rich Trott
0f3149eb98 doc: fix minor style issues in http.md
PR-URL: https://github.com/nodejs/node/pull/7528
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-07-06 22:11:31 -07:00
Jeremiah Senkpiel
7628031847 2016-07-06, Version 6.3.0 (Current)
Notable changes:

* buffer: Added `buffer.swap64()` to compliment `swap16()` &
`swap32()`. (Zach Bjornson) https://github.com/nodejs/node/pull/7157
* build: New `configure` options have been added for building Node.js
as a shared library. (Stefan Budeanu)
https://github.com/nodejs/node/pull/6994
  - The options are: `--shared`, `--without-v8-platform` &
`--without-bundled-v8`.
* crypto: Root certificates have been updated. (Ben Noordhuis)
https://github.com/nodejs/node/pull/7363
* debugger: The server address is now configurable via
`--debug=<address>:<port>`. (Ben Noordhuis)
https://github.com/nodejs/node/pull/3316
* npm: Upgraded npm to v3.10.3 (Kat Marchán)
https://github.com/nodejs/node/pull/7515 & (Rebecca Turner)
https://github.com/nodejs/node/pull/7410
* readline: Added the `prompt` option to the readline constructor.
(Evan Lucas) https://github.com/nodejs/node/pull/7125
* repl / vm: `sigint`/`ctrl+c` will now break out of infinite loops
without stopping the Node.js instance. (Anna Henningsen)
https://github.com/nodejs/node/pull/6635
* src:
  - Added a `node::FreeEnvironment` public C++ API. (Cheng Zhao)
https://github.com/nodejs/node/pull/3098
  - Refactored `require('constants')`, constants are now available
directly from their respective modules. (James M Snell)
https://github.com/nodejs/node/pull/6534
* stream: Improved `readable.read()` performance by up to 70%. (Brian
White) https://github.com/nodejs/node/pull/7077
* timers: `setImmediate()` is now up to 150% faster in some situations.
(Andras) https://github.com/nodejs/node/pull/6436
* util: Added a `breakLength` option to `util.inspect()` to control how
objects are formatted across lines. (cjihrig)
https://github.com/nodejs/node/pull/7499
* v8-inspector: Experimental support has been added for debugging
Node.js over the inspector protocol. (Ali Ijaz Sheikh)
https://github.com/nodejs/node/pull/6792
  - *Note: This feature is experimental, and it could be altered or
removed.*
  - You can try this feature by running Node.js with the `--inspect`
flag.

Refs: https://github.com/nodejs/node/pull/7441
PR-URL: https://github.com/nodejs/node/pull/7550
2016-07-06 20:00:46 +02:00
cjihrig
5a571a5fa0 doc: fix detached child stdio example
The example changed by this commit uses ['ignore'] where
'ignore' is intended.

Fixes: https://github.com/nodejs/node/issues/7269
PR-URL: https://github.com/nodejs/node/pull/7540
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-07-06 11:59:21 -04:00
Anna Henningsen
cd4dbf3348
doc: add added: information for timers
Ref: https://github.com/nodejs/node/issues/6578
PR-URL: https://github.com/nodejs/node/pull/7493
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-07-05 21:49:21 +02:00
cjihrig
a2ee21db84 util: add an option for configuring break length
This commit adds a breakLength option to util.inspect(). This
option allows users to control the length at which object keys
are split across multiple lines. For backwards compatibility,
this option defaults to 60.

Fixes: https://github.com/nodejs/node/issues/7305
PR-URL: https://github.com/nodejs/node/pull/7499
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2016-07-05 10:17:28 -04:00
Tarun Garg
475dc439e2
doc: fix documentation of process.argv
The current documentation states that if run something like
`node app.js` then in our process.argv array first elements is `node`,
but actually it's `process.execPath` not `node`
as documentation currently suggests.

Fixes: https://github.com/nodejs/node/issues/7434
PR-URL: https://github.com/nodejs/node/pull/7449
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-07-04 16:49:01 +02:00
Rich Trott
42de4bb819 doc: improve usage of zero/0
PR-URL: https://github.com/nodejs/node/pull/7466
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-06-30 21:56:41 -07:00
Daniel Bevenius
02afb057b5
doc: fixing minor typo in AtExit hooks section
PR-URL: https://github.com/nodejs/node/pull/7485
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-06-30 07:34:56 +02:00
Anna Henningsen
010ac70892
doc: fix broken refs to url.parse() in http docs
PR-URL: https://github.com/nodejs/node/pull/7392
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-06-29 04:07:28 +02:00
Anna Henningsen
e8356b25cd
doc: add added: information for https
Ref: https://github.com/nodejs/node/issues/6578
PR-URL: https://github.com/nodejs/node/pull/7392
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-06-29 04:07:25 +02:00
Anna Henningsen
72500f942b
doc: add added: information for http
Ref: https://github.com/nodejs/node/issues/6578
PR-URL: https://github.com/nodejs/node/pull/7392
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-06-29 04:06:57 +02:00
James M Snell
86e07b7c24 doc: general improvements to timers.md
Overall improvements to timers.md documentation,

Includes squashed commit from @bengl:

  doc: add timer classes

  The timers returned by `setTimeout` and friends are
  actually instances of `Timeout` and `Immediate`.
  Documenting them as such, so that the `ref` and
  `unref` methods can be identified as methods on
  `Timeout` objects.

  Sparked by discussion in #5792

PR-URL: https://github.com/nodejs/node/pull/6937
Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2016-06-28 07:39:31 -07:00
Zach Bjornson
a1059afd39 buffer: speed up swap16/32, add swap64
* Speed up buffer.swap16 and swap32 by using builtins. Up to ~6x gain.
  Drop transition point between JS and C++ implementations accordingly.
  Amount of performance improvement not only depends on buffer size but
  also memory alignment.
* Fix tests: C++ impl tests were testing 0-filled buffers so were
  always passing.
* Add similar buffer.swap64 method.
* Make buffer-swap benchmark mirror JS impl.

doc/api/buffer.markdown has an entry of "added: REPLACEME" that should
be changed to the correct release number before tagged.

Because node is currently using a very old version of cpplint.py it
doesn't know that std::swap() has moved from <algorithm> to <utility> in
c++11. So until cpplint.py is updated simply NOLINT the line.
Technically it should be NOLINT(build/include_what_you_use), but that
puts the line over 80 characters causing another lint error.

PR-URL: https://github.com/nodejs/node/pull/7157
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-06-27 14:38:37 -06:00
Rich Trott
4220e86414 doc: fix typographic error in process doc
An apostrophe was being used where a backtick was called for, resulting
in improper rendering.

PR-URL: https://github.com/nodejs/node/pull/7431
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Ingvar Stepanyan <me@rreverser.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-06-27 08:52:49 -07:00
Ruslan Iusupov
97dc38e8fc doc: fix "sign.verify" typo in crypto doc.
Fix typo in example

PR-URL: https://github.com/nodejs/node/pull/7411
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-06-27 08:43:35 -07:00
sartrey
926707f0a7 doc: clarify child_process stdout/stderr types
Clarify how the encoding option interacts with the data
type of child process stdout and stderr.

Fixes: https://github.com/nodejs/node/issues/6666
PR-URL: https://github.com/nodejs/node/pull/7361
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-06-27 09:43:01 -04:00
Evan Lucas
3f5623dd46 readline: allow passing prompt to constructor
Previously, one would have to call setPrompt after calling
rl.createInterface. Now, the prompt string can be set by passing the
prompt property.

PR-URL: https://github.com/nodejs/node/pull/7125
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
2016-06-25 12:10:28 -05:00
Italo A. Casas
79f961aa09
doc: fix link in the stream doc
fixing typo
fixing broken links

PR-URL: https://github.com/nodejs/node/pull/7347
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2016-06-23 22:14:03 +02:00
akki
f3114e2a3e doc: fix repl defineCommand example
Fixes: https://github.com/nodejs/node/issues/7357
PR-URL: https://github.com/nodejs/node/pull/7365
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-06-23 13:48:59 -04:00
Italo A. Casas
c2e6078ed9
doc: add added: information for tls
Ref: https://github.com/nodejs/node/issues/6578
PR-URL: https://github.com/nodejs/node/pull/7018
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-06-23 02:01:29 +02:00
Kyle E. Mitchell
86fdbe0c25
doc: mention http request "aborted" events
Fixes: https://github.com/nodejs/node/issues/6925
PR-URL: https://github.com/nodejs/node/pull/7270
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-06-23 01:30:34 +02:00
Rich Trott
92adbe4793 doc: add argument information for socket.destroy()
PR-URL: https://github.com/nodejs/node/pull/7238
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
2016-06-21 21:07:18 -07:00
James M Snell
ecc48a154d doc: general improvements to os.md copy
PR-URL: https://github.com/nodejs/node/pull/7124
Reviewed-By: Brian White <mscdex@mscdex.net>
2016-06-21 11:17:05 -07:00
vsemozhetbyt
58a241d537
doc: fix typos in the stream doc
PR-URL: https://github.com/nodejs/node/pull/7336
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-06-21 18:57:43 +02:00
Tushar Mathur
193afef3b0 doc: document socket.destroyed
Fixes: https://github.com/nodejs/node/issues/5898
PR-URL: https://github.com/nodejs/node/pull/6128
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2016-06-21 11:09:38 -04:00
Richard Lau
a06ccdbdb5
doc: correct added: information for fs.access
fs.access and fs.accessSync were added to Node v0.11.15 via 2944934

PR-URL: https://github.com/nodejs/node/pull/7299
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Ref: https://github.com/nodejs/node/pull/6717
Ref: https://github.com/nodejs/node/issues/6578
2016-06-18 21:15:52 +02:00
Anna Henningsen
740d8cf5e0
doc: add added: information for repl
Ref: https://github.com/nodejs/node/issues/6578
PR-URL: https://github.com/nodejs/node/pull/7256
Reviewed-By: Julian Duque <julianduquej@gmail.com>
2016-06-18 20:49:54 +02:00
Anna Henningsen
6a93ab11a9
repl: break on sigint/ctrl+c
Adds the ability to stop execution of the current REPL command
when receiving SIGINT. This applies only to the default eval
function.

Fixes: https://github.com/nodejs/node/issues/6612
PR-URL: https://github.com/nodejs/node/pull/6635
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-06-18 20:44:25 +02:00
Anna Henningsen
0815b9401d
vm: add ability to break on sigint/ctrl+c
- Adds the `breakEvalOnSigint` option to `vm.runIn(This)Context`.
  This uses a watchdog thread to wait for SIGINT and generally works
  just like the existing `timeout` option.

- Adds a method to the existing timer-based watchdog to check if it
  stopped regularly or by running into the timeout. This is used to
  tell a SIGINT abort from a timer-based one.

- Adds (internal) `process._{start,stop}SigintWatchdog` methods to
  start/stop the watchdog thread used by the above option manually.
  This will be used in the REPL to set up SIGINT handling before
  entering terminal raw mode, so that there is no time window in
  which Ctrl+C fully aborts the process.

PR-URL: https://github.com/nodejs/node/pull/6635
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-06-18 20:44:16 +02:00
Luigi Pinca
de9a84186e
doc: fix broken link in vm.md
PR-URL: https://github.com/nodejs/node/pull/7304
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
2016-06-17 22:25:30 +02:00
cjihrig
62c8e7b922 doc: fix cluster worker 'message' event
This commit adds the missing handle argument to the cluster
worker 'message' event. It also adds a link to the process
'message' event for reference.

Refs: https://github.com/nodejs/node/pull/7297
PR-URL: https://github.com/nodejs/node/pull/7309
Reviewed-By: Brian White <mscdex@mscdex.net>
2016-06-17 14:55:08 -04:00
Greyson Parrelli
62a858c60f doc: fix events typo
This commit removes an extraneous word.

PR-URL: https://github.com/nodejs/node/pull/7329
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2016-06-17 13:25:28 -04:00
kimown
d06820c624 doc: use Buffer.byteLength for Content-Length
As the description in http.md:

> If the body contains higher coded characters then
Buffer.byteLength() should be used to determine the number of
bytes in a given encoding.

PR-URL: https://github.com/nodejs/node/pull/7274
Reviewed-By: Brian White <mscdex@mscdex.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jackson Tian <shyvo1987@gmail.com>
2016-06-12 23:17:45 +08:00
Rich Trott
4f2aec307e doc: add information for IncomingMessage.destroy()
Add documentation for `http.IncomingMessage.prototype.destroy()`.

PR-URL: https://github.com/nodejs/node/pull/7237
Fixes: https://github.com/nodejs/node/issues/4226
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com>
2016-06-11 20:11:31 -07:00
James M Snell
197a465280 zlib: move constants into zlib.constants
zlib constants were previously being added to binding in node_zlib.cc.
This moves the zlib constants to node_constants.cc for consistency with
the recent constants refactoring:
  https://github.com/nodejs/node/pull/6534

Adds require('zlib').constants to expose the constants
Docs-only deprecates the constants hung directly off require('zlib')
Removes a couple constants from the docs that apparently no longer
exist in the code

PR-URL: https://github.com/nodejs/node/pull/7203
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-06-11 17:24:35 -07:00
James M Snell
a173483619 doc: general improvements to path.md copy
PR-URL: https://github.com/nodejs/node/pull/7122
Reviewed-By: Brian White <mscdex@mscdex.net>
2016-06-11 17:20:57 -07:00
Rich Trott
f2c59d9658 doc: url.format() parameter may be a string
PR-URL: https://github.com/nodejs/node/pull/7235
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com>
2016-06-10 21:45:02 -07:00
Rich Trott
60891c6ef0 doc: clarify use of 0 port value
Clarify that using a port value of `0` will result in the operating
system identifying an available port for use.

PR-URL: https://github.com/nodejs/node/pull/7206
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: cjihrig - Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-06-09 22:20:50 -07:00
Jesús Leganés Combarro "piranna
0cd0118334 stream: 'data' argument on callback of Transform._flush()
Add a `data` argument on Transform._flush() callback to be API
consistent with Transform._transform().

Fixes: https://github.com/nodejs/node/issues/3707
PR-URL: https://github.com/nodejs/node/pull/3708
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2016-06-09 11:06:01 +02:00
cjihrig
779091ffdb doc: remove cluster.setupMaster() myth
cluster.setupMaster() can be called more than once. Core even has
tests for this functionality. This commit removes an incorrect
statement to the contrary from the documentation.

Fixes: https://github.com/nodejs/node/issues/7156
PR-URL: https://github.com/nodejs/node/pull/7179
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com>
2016-06-08 11:50:32 -04:00
James M Snell
d9e0d8b810
doc: fix minor nit introduced in readline.md
PR-URL: https://github.com/nodejs/node/pull/7198
Reviewed-By: Julian Duque <julianduquej@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-06-07 18:55:32 -04:00
Trevor Norris
e0b8dd59bc src: remove final trace of raw encoding
A message stuck around in the native API warning users to not use 'raw'
encoding. Followed by an abort(). This is no longer necessary since all
other signs of 'raw' encoding have been removed.

PR-URL: https://github.com/nodejs/node/pull/7111
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-06-07 13:54:24 -06:00
Trevor Norris
54cc7212df buffer: introduce latin1 encoding term
When node began using the OneByte API (f150d56) it also switched to
officially supporting ISO-8859-1. Though at the time no new encoding
string was introduced.

Introduce the new encoding string 'latin1' to be more explicit. The
previous 'binary' and documented as an alias to 'latin1'.  While many
tests have switched to use 'latin1', there are still plenty that do both
'binary' and 'latin1' checks side-by-side to ensure there is no
regression.

PR-URL: https://github.com/nodejs/node/pull/7111
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-06-07 13:51:14 -06:00
James M Snell
c300ba2212 doc: clarify rl.question callback args
Clarify that readline's rl.question() callback does not
use the err back pattern.

Fixes: https://github.com/nodejs/node/issues/4833
PR-URL: https://github.com/nodejs/node/pull/7022
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2016-06-07 07:15:14 -07:00
James M Snell
ed8b600b98 doc: general improvements to readline.md copy
PR-URL: https://github.com/nodejs/node/pull/7022
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2016-06-07 07:15:09 -07:00
Rich Trott
a78c2335b1 doc: use consistent typography in streams.md
In prose, always surround `null`-as-a-value in backticks.

PR-URL: https://github.com/nodejs/node/pull/6986
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
2016-06-06 17:06:58 -07:00
James M Snell
a32f7eb4be doc: general improvements to process.md copy
PR-URL: https://github.com/nodejs/node/pull/7029
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2016-06-06 14:53:10 -07:00
James M Snell
c339c58c4f doc: general improvements to repl.md copy
The repl documentation has always been rather lacking. This is
a first step towards making significant improvements.

PR-URL: https://github.com/nodejs/node/pull/7002
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-06-06 14:49:06 -07:00
Julian Duque
0ed4d8c535 doc: add added: information for readline
Got the information from git history, I added the version when Interface
was exported as class (v0.1.104), it was an internal class on previous
versions.

Refs: https://github.com/nodejs/node/issues/6578
PR-URL: https://github.com/nodejs/node/pull/6996
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-06-06 09:11:14 -07:00
Jonathan Montane
c3e86de9ba doc: improved syntax consistency in console.md
`stdout` was written as `inline code` most of the time,
except for the `console.time` and `console.timeEnd`
functions which made it a bit more tedious to read about.
Now it's always using inline code.

PR-URL: https://github.com/nodejs/node/pull/7062
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-06-06 09:07:33 -07:00
Lance Ball
d976d66cfc doc: clarify fs.access works on directories too.
This is maybe more verbose than needed, since the same information is
repeated several times. An alternative, maybe a single short sentence at
the beginning is better. E.g.

Fixes: https://github.com/nodejs/node/issues/7110
PR-URL: https://github.com/nodejs/node/pull/7113
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-06-06 08:46:08 -07:00
James M Snell
80f1fbb00f doc: general improvements to querystring.md copy
PR-URL: https://github.com/nodejs/node/pull/7023
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
2016-06-06 08:35:19 -07:00
James M Snell
267556762d doc: fix header depth of util.isSymbol
PR-URL: https://github.com/nodejs/node/pull/7138
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-06-06 08:19:03 -07:00
James M Snell
80ea0c5a64 doc: general improvements to stream.md copy
Majoring restructuring and update for streams doc.
This is the first step of multiple to updating and
correcting the streams documentation.

PR-URL: https://github.com/nodejs/node/pull/6947
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2016-06-06 08:17:19 -07:00
Julian Duque
71996506e9 doc: add added: information for dns
Got the information from git history and I ignored previous version of
dns attached to `node.dns` (pre v0.1.16).

There is a case where `dns.resolveNaptr` were intented to be in v0.7.12 and
it was reverted and addec back on `v0.9.12`, I left the latest version
when module was introduced. Same for `dns.resolvePtr` who was referenced
before but it was only added on `v6.0.0`

Refs: https://github.com/nodejs/node/issues/6578
PR-URL: https://github.com/nodejs/node/pull/7021
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-06-03 12:32:09 -07:00
Julian Duque
bed44c94a0 doc: add added: information for path
Got the information from git history mostly, I ignored previous path
methods attached to `node.path` (pre v0.1.16).

Refs: https://github.com/nodejs/node/issues/6578
PR-URL: https://github.com/nodejs/node/pull/6985
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-06-03 12:30:17 -07:00
Italo A. Casas
8bccc9e6c8 doc: add added information for net
Ref: https://github.com/nodejs/node/issues/6578
PR-URL: https://github.com/nodejs/node/pull/7038
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-06-02 17:15:22 -07:00
James M Snell
83e32266b6 doc: general improvements to punycode.md copy
PR-URL: https://github.com/nodejs/node/pull/7025
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2016-06-02 16:35:56 -07:00
Michael Dawson
138c7af42a doc: add links to platform specific mechanisms
As requested in earlier PR adding detail for Aix, add link
for each of the platform specific technologies used for
file system watching.

PR-URL: https://github.com/nodejs/node/pull/7071
Reviewed-By: Robert Jefe Lindstädt <robert.lindstaedt@gmail.com>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Yorkie Liu <yorkiefixer@gmail.com>
2016-06-02 11:28:53 -04:00
Jeremiah Senkpiel
98de4abae3 tty: use blocking mode on OS X
OS X has a tiny 1kb hard-coded buffer size for stdout / stderr to
TTYs (terminals). Output larger than that causes chunking, which ends
up having some (very small but existent) delay past the first chunk.
That causes two problems:

1. When output is written to stdout and stderr at similar times, the
two can become mixed together (interleaved). This is especially
problematic when using control characters, such as \r. With
interleaving, chunked output will often have lines or characters erased
unintentionally, or in the wrong spots, leading to broken output.
CLI apps often extensively use such characters for things such as
progress bars.

2. Output can be lost if the process is exited before chunked writes
are finished flushing. This usually happens in applications that use
`process.exit()`, which isn't infrequent.

See https://github.com/nodejs/node/issues/6980 for more info.

This became an issue as result of the Libuv 1.9.0 upgrade. A fix to
an unrelated issue broke a hack previously required for the OS X
implementation. This resulted in an unexpected behavior change in node.
The 1.9.0 upgrade was done in c3cec1eefc,
which was included in v6.0.0.
Full details of the Libuv issue that induced this are at
https://github.com/nodejs/node/issues/6456#issuecomment-219974514

Refs: https://github.com/nodejs/node/pull/1771
Refs: https://github.com/nodejs/node/issues/6456
Refs: https://github.com/nodejs/node/pull/6773
Refs: https://github.com/nodejs/node/pull/6816
PR-URL: https://github.com/nodejs/node/pull/6895
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2016-06-01 18:57:45 -04:00
Jeremiah Senkpiel
0cc903544d doc: addresses nits in string_decoder, url, util
- Only `@@toStringTag` affects `util.isError()`, this is the reason why
it uses `Object.prototype.toString.call(argument)` under the hood.
- Shows an actual Euro symbol for reference.
- Uses line-drawing characters for the URL chart & fixes the chart
borders.

PR-URL: https://github.com/nodejs/node/pull/7026
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
2016-05-31 10:28:14 -04:00
Pavel Feldman
84ad31fff3 src,lib: v8-inspector support
This change introduces experimental v8-inspector support. This brings
the DevTools debug protocol allowing Node.js to be debugged with
Chrome DevTools native, or through other debuggers supporting that
protocol.

Partial WebSocket support, to the extent required by DevTools, is
included. This is derived from the implementation in Blink.

v8-inspector support can be disabled by the --without-inspector
configure flag.

PR-URL: https://github.com/nodejs/node/pull/6792
Reviewed-By: jasnell - James M Snell <jasnell@gmail.com>
Reviewed-By: addaleax - Anna Henningsen <anna@addaleax.net>
Reviewed-By: bnoordhuis - Ben Noordhuis <info@bnoordhuis.nl>
2016-05-30 09:05:46 -07:00
Rich Trott
112b9cdad7 doc: improve debugger doc prose
PR-URL: https://github.com/nodejs/node/pull/7007
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2016-05-29 19:28:18 -07:00