Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: backport 200315c from V8 upstream (v4.x) #4128

Closed
Closed
Changes from 1 commit
Commits
Show all changes
132 commits
Select commit Hold shift + click to select a range
44d4a02
deps: upgrade npm to 2.14.9
othiym23 Nov 6, 2015
75b4613
test: enhance fs-watch-recursive test
thefourtheye Aug 28, 2015
aef3d54
build: fix configuring with prebuilt libraries
zyxar Sep 30, 2015
5689630
docs: fs - change links to buffer encoding to Buffer class anchor
Oct 13, 2015
38a5ae1
doc: stdout/stderr can block when directed to file
bnoordhuis Oct 3, 2015
22bfe22
doc: add method links in events.markdown
a0viedo Nov 6, 2015
bf48969
repl: To exit, press ^C again or type .exit.
hemanth Nov 7, 2015
4a94c0a
doc: add caveats of algs and key size in crypto
Jul 27, 2015
550c606
src: Revert "nix stdin _readableState.reading"
silverwind Oct 26, 2015
d02365b
doc: add note about timeout delay > TIMEOUT_MAX
sitegui Oct 25, 2015
dfc2707
doc:fix function param order in assert doc
birnam Oct 26, 2015
d1cedbd
zlib: pass kind to recursive calls to flush
Oct 26, 2015
1543c78
zlib: only apply drain listener if given callback
CraigCav Oct 26, 2015
84f8eb7
test: add test-zlib-flush-drain
Nov 11, 2015
98762d2
doc: added what buf.copy returns
baslr Oct 28, 2015
935b8be
Add missing va_end before return
usta Oct 28, 2015
08ab9f3
doc: made code spans more visible in the API docs
phillipj Oct 28, 2015
948af71
module: remove unnecessary JSON.stringify
zertosh Oct 29, 2015
bb20abb
doc: Updated streams simplified constructor API
tomgco Oct 30, 2015
c10f17f
test: fix path to module for repl test on Windows
mcornac Oct 30, 2015
b3b55a5
doc: fix crypto spkac function descriptions
jas- Oct 31, 2015
486d287
repl: don't crash if cannot open history file
evanlucas Nov 2, 2015
5a23bb5
doc: rename iojs-* groups to nodejs-*
srl295 Nov 2, 2015
d410d58
doc: fix wrong date and known issue in changelog.md
jasnell Nov 3, 2015
7009e01
test: fix test-net-persistent-keepalive for AIX
Nov 3, 2015
d7b4f75
doc: typo fix in readme.md
SPGB Nov 3, 2015
2570cb7
test: fix test-module-loading-error for musl
hmalphettes Nov 10, 2015
9ce1f75
doc: add LTS info to COLLABORATOR_GUIDE.md
Oct 19, 2015
9970b76
doc: update lts description in the collaborator guide
jasnell Nov 5, 2015
0fb40b4
test: Fix test-cluster-worker-exit.js for AIX
Nov 4, 2015
1064eb6
util: use regexp instead of str.replace().join()
hellopao Nov 6, 2015
a632db5
dns: prevent undefined values in results
Nov 6, 2015
07b5791
test: use really invalid hostname
thefourtheye Nov 8, 2015
e86817c
cluster: send suicide message on disconnect
cjihrig Nov 9, 2015
64e6d06
doc: add thealphanerd to collaborators
Nov 9, 2015
5cbfb76
doc: add saghul as a collaborator
saghul Nov 9, 2015
a49dd89
doc: add romankl to collaborators
r-52 Nov 9, 2015
3435f87
doc: add note to util.isBuffer
evanlucas Nov 12, 2015
c37a560
crypto: Improve error checking and reporting
stefanmb Nov 9, 2015
8b6120d
doc: add note on tls connection meta data methods
DaftMonk Nov 10, 2015
2f8caaf
doc: sort assert alphabetically
tflanagan Nov 4, 2015
2433e3d
doc: sort buffer alphabetically
tflanagan Nov 4, 2015
2c5e7ed
doc: sort child_process alphabetically
tflanagan Nov 4, 2015
4485236
doc: sort cluster alphabetically
tflanagan Nov 4, 2015
1b668b5
doc: sort console alphabetically
tflanagan Nov 4, 2015
720f068
doc: sort dns alphabetically
tflanagan Nov 4, 2015
ecfbbf0
doc: sort crypto alphabetically
tflanagan Nov 4, 2015
128d100
doc: sort dgram alphabetically
tflanagan Nov 4, 2015
c8ba557
doc: sort errors alphabetically
tflanagan Nov 4, 2015
1f644b1
doc: sort events alphabetically
tflanagan Nov 4, 2015
fc346fb
doc: sort fs alphabetically
tflanagan Nov 4, 2015
806b694
doc: sort globals alphabetically
tflanagan Nov 4, 2015
bbd00ee
doc: sort os alphabetically
tflanagan Nov 4, 2015
7827749
doc: sort path alphabetically
tflanagan Nov 4, 2015
84b9376
doc: sort punycode alphabetically
tflanagan Nov 4, 2015
d7b685c
doc: sort querystring alphabetically
tflanagan Nov 4, 2015
0814b8c
doc: sort vm alphabetically
tflanagan Nov 4, 2015
fd2e926
doc: sort url alphabetically
tflanagan Nov 4, 2015
ea66bd3
doc: sort tty alphabetically
tflanagan Nov 4, 2015
cf96a53
doc: sort timers alphabetically
tflanagan Nov 4, 2015
babc561
doc: sort string_decoder alphabetically
tflanagan Nov 4, 2015
45f7d75
doc: sort repl alphabetically
tflanagan Nov 4, 2015
fdeaec5
doc: sort readline alphabetically
tflanagan Nov 4, 2015
133f84e
doc: sort modules alphabetically
tflanagan Nov 4, 2015
2cac10d
doc: sort http alphabetically
tflanagan Nov 4, 2015
cb62bb2
doc: sort https alphabetically
tflanagan Nov 4, 2015
57f298f
doc: sort util alphabetically
tflanagan Nov 5, 2015
e670439
doc: sort zlib alphabetically
tflanagan Nov 5, 2015
2564672
doc: sort process alphabetically
tflanagan Nov 5, 2015
600bc56
doc: sort net alphabetically
tflanagan Nov 5, 2015
4635696
doc: sort stream alphabetically
tflanagan Nov 5, 2015
65267bc
doc: sort tls alphabetically
tflanagan Nov 5, 2015
877d86d
doc: add link to [customizing util.inspect colors].
jmm Nov 10, 2015
208de53
doc: document release types in readme
rvagg Oct 22, 2015
5254fda
doc: repl: add defineComand and displayPrompt
bengl Nov 11, 2015
f5dde5e
test: fix flaky test test-http-pipeline-flood
dnakamura Sep 14, 2015
9294523
test: refactor test-http-pipeline-flood
Trott Nov 2, 2015
643d949
docs: improve discoverability of Code of Conduct
ashleygwilliams Nov 11, 2015
4bfa159
doc: replace head of readme with updated text
rvagg Oct 22, 2015
0c5429a
doc: clarify duplicate header handling
bengl Nov 13, 2015
fc629c2
doc: reword message.headers to indicate they are not read-only
tflanagan Nov 13, 2015
79220be
doc: address use of profanity in code of conduct
jasnell Nov 14, 2015
ff992ff
doc: consistent reference-style links
bengl Nov 14, 2015
c914516
doc: sort repl alphabetically
tflanagan Nov 16, 2015
97a4862
deps: backport 819b40a from V8 upstream
targos Nov 20, 2015
93cfe65
doc: update WORKING_GROUPS.md to include Intl
srl295 Oct 7, 2015
4c97fb7
doc: Adding best practises for crypto.pbkdf2
tomgco Oct 9, 2015
31b247b
src: add BE support to StringBytes::Encode()
exinfinitum Oct 7, 2015
982a1a2
tls: remove util and calls to util.format
Oct 20, 2015
41453b3
doc: clarify that fs streams expect blocking fd
XeCycle Nov 3, 2015
0482ec4
test: numeric flags to fs.open
XeCycle Nov 3, 2015
d2d4f17
doc: numeric flags to fs.open
XeCycle Nov 3, 2015
0f571e7
child_process: don't fork bomb ourselves from -e
bnoordhuis Oct 28, 2015
a61f7b7
cluster: remove handles when disconnecting worker
bnoordhuis Nov 3, 2015
d5883be
tls: Use SHA1 for sessionIdContext in FIPS mode
stefanmb Nov 9, 2015
43a0d1e
crypto: DSA parameter validation in FIPS mode
stefanmb Nov 10, 2015
b78b8a9
test: add test for invalid DSA key size
stefanmb Nov 13, 2015
effba0b
test: add hasFipsCrypto to test/common.js
stefanmb Nov 12, 2015
823b8ba
test: increase crypto strength for FIPS standard
stefanmb Nov 10, 2015
dc09dea
test: stronger crypto in test fixtures
stefanmb Nov 10, 2015
3338fd7
test: skip/replace weak crypto tests in FIPS mode
stefanmb Nov 10, 2015
8c9d6c6
buffer: let WriteFloatGeneric silently drop values
pmq20 Nov 16, 2015
1f653f6
child_process: add safety checks on stdio access
cjihrig Nov 12, 2015
4ca83c2
querystring: Parse multiple separator characters
yosuke-furukawa Nov 12, 2015
6d29b02
build: fix --with-intl=system-icu for x-compile
srl295 Nov 13, 2015
04d3c1d
test: run pipeline flood test in parallel
Trott Nov 13, 2015
2d39141
test: fix flaky SmartOS test
Trott Nov 15, 2015
d93921a
test: skip test if FreeBSD jail will break it
Trott Nov 15, 2015
9827814
test: module loading error fix solaris #3798
Nov 16, 2015
746e279
module: cache regular expressions
evanlucas Nov 17, 2015
3204938
test: move test-specific function out of common
Trott Nov 17, 2015
40311b6
test: fix flaky test-child-process-spawnsync-input
Trott Nov 17, 2015
5f0dd69
test: avoid test timeouts on rpi
stefanmb Nov 18, 2015
ebf072a
doc: clarify module loading behavior
cjihrig Nov 19, 2015
f036401
doc: add reference for buffer.inspect()
cjihrig Nov 19, 2015
9bc9a2b
test: retry on smartos if ECONNREFUSED
Trott Nov 20, 2015
4dfc823
doc: fix broken references
gromnitsky Nov 20, 2015
2577a30
net: add local address/port for better errors
jscissr Nov 20, 2015
63c39b6
doc: fix rare case of misaligned columns
silverwind Nov 21, 2015
6b4cbd6
test: address flaky test-http-client-timeout-event
Trott Nov 22, 2015
45e27d1
test: remove flaky status for cluster test
Trott Nov 23, 2015
10cd439
doc: replace sane with reasonable
lewiscowper Nov 23, 2015
1de55d3
test: fix test-domain-exit-dispose-again
Nov 23, 2015
5702eef
test: skip test if in FreeBSD jail
Trott Nov 24, 2015
ef34bd7
doc: message.header duplication correction
bengl Nov 24, 2015
2a36661
doc: fix typo in README
Trott Nov 24, 2015
003a885
test: mark fork regression test flaky on windows
Trott Nov 25, 2015
5dc1f53
doc: fix color of linked code blocks
Nov 29, 2015
9694983
test: remove flaky designation from ls-no-sslv3
Trott Nov 1, 2015
63e4adb
test: mark cluster-net-send test flaky on windows
Trott Nov 24, 2015
d7637c9
test: mark test flaky on FreeBSD
Trott Nov 25, 2015
7e30ee6
deps: backport 200315c from V8 upstream (v4.x)
vkurchatkin Dec 3, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc: consistent reference-style links
Moved all the URLs in API docs to the bottom of the files as
reference-style links.

PR-URL: #3845
Reviewed-By: James M Snell <jasnell@gmail.com>
bengl authored and Myles Borins committed Nov 17, 2015
commit ff992ffa2a839c050b28bbebc810410d5d0f8711
33 changes: 18 additions & 15 deletions doc/api/addons.markdown
Original file line number Diff line number Diff line change
@@ -7,14 +7,12 @@ knowledge of several libraries:
- V8 JavaScript, a C++ library. Used for interfacing with JavaScript:
creating objects, calling functions, etc. Documented mostly in the
`v8.h` header file (`deps/v8/include/v8.h` in the Node.js source
tree), which is also available
[online](https://v8docs.nodesource.com/).
tree), which is also available [online][].

- [libuv](https://github.com/libuv/libuv), C event loop library.
Anytime one needs to wait for a file descriptor to become readable,
wait for a timer, or wait for a signal to be received one will need
to interface with libuv. That is, if you perform any I/O, libuv will
need to be used.
- [libuv][], C event loop library. Anytime one needs to wait for a file
descriptor to become readable, wait for a timer, or wait for a signal
to be received one will need to interface with libuv. That is, if you
perform any I/O, libuv will need to be used.

- Internal Node.js libraries. Most importantly is the `node::ObjectWrap`
class which you will likely want to derive from.
@@ -25,9 +23,8 @@ Node.js statically compiles all its dependencies into the executable.
When compiling your module, you don't need to worry about linking to
any of these libraries.

All of the following examples are available for
[download](https://github.com/rvagg/node-addon-examples) and may be
used as a starting-point for your own Addon.
All of the following examples are available for [download][] and may
be used as a starting-point for your own Addon.

## Hello world

@@ -77,7 +74,7 @@ The `module_name` needs to match the filename of the final binary (minus the
The source code needs to be built into `addon.node`, the binary Addon. To
do this we create a file called `binding.gyp` which describes the configuration
to build your module in a JSON-like format. This file gets compiled by
[node-gyp](https://github.com/nodejs/node-gyp).
[node-gyp][].

{
"targets": [
@@ -113,10 +110,9 @@ Please see patterns below for further information or
## Addon patterns

Below are some addon patterns to help you get started. Consult the online
[v8 reference](http://izs.me/v8-docs/main.html) for help with the various v8
calls, and v8's [Embedder's Guide](http://code.google.com/apis/v8/embed.html)
for an explanation of several concepts used such as handles, scopes,
function templates, etc.
[v8 reference][] for help with the various v8 calls, and v8's
[Embedder's Guide][] for an explanation of several concepts used such as
handles, scopes, function templates, etc.

In order to use these examples you need to compile them using `node-gyp`.
Create the following `binding.gyp` file:
@@ -869,3 +865,10 @@ Test in JavaScript by running:

// test.js
var addon = require('./build/Release/addon');

[online]: https://v8docs.nodesource.com/
[libuv]: https://github.com/libuv/libuv
[download]: https://github.com/rvagg/node-addon-examples
[node-gyp]: https://github.com/nodejs/node-gyp
[v8 reference]: http://izs.me/v8-docs/main.html
[Embedder's Guide]: http://code.google.com/apis/v8/embed.html
4 changes: 3 additions & 1 deletion doc/api/assert.markdown
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ operator ( `===` ).

## assert.doesNotThrow(block[, error][, message])

Expects `block` not to throw an error. See [assert.throws()](#assert_assert_throws_block_error_message) for more details.
Expects `block` not to throw an error. See [assert.throws()][] for more details.

If `block` throws an error and if it is of a different type from `error`, the
thrown error will get propagated back to the caller. The following call will
@@ -128,3 +128,5 @@ Custom error validation:
},
"unexpected error"
);

[assert.throws()]: #assert_assert_throws_block_error_message
15 changes: 8 additions & 7 deletions doc/api/buffer.markdown
Original file line number Diff line number Diff line change
@@ -114,8 +114,7 @@ Example:
* `buf1` {Buffer}
* `buf2` {Buffer}

The same as [`buf1.compare(buf2)`](#buffer_buf_compare_otherbuffer). Useful
for sorting an Array of Buffers:
The same as [`buf1.compare(buf2)`][]. Useful for sorting an Array of Buffers:

var arr = [Buffer('1234'), Buffer('0123')];
arr.sort(Buffer.compare);
@@ -287,11 +286,10 @@ buffer.
* `byteOffset` Number, Optional, Default: 0
* Return: Number

Operates similar to
[Array#indexOf()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf).
Accepts a String, Buffer or Number. Strings are interpreted as UTF8. Buffers
will use the entire buffer. So in order to compare a partial Buffer use
`Buffer#slice()`. Numbers can range from 0 to 255.
Operates similar to [Array#indexOf()][]. Accepts a String, Buffer or Number.
Strings are interpreted as UTF8. Buffers will use the entire buffer. So in order
to compare a partial Buffer use `Buffer#slice()`. Numbers can range from 0 to
255.

### buf.length

@@ -932,3 +930,6 @@ un-pooled Buffer instance using SlowBuffer and copy out the relevant bits.

Though this should be used sparingly and only be a last resort *after* a developer
has actively observed undue memory retention in their applications.

[`buf1.compare(buf2)`]: #buffer_buf_compare_otherbuffer
[Array#indexOf()]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf
51 changes: 29 additions & 22 deletions doc/api/child_process.markdown
Original file line number Diff line number Diff line change
@@ -12,10 +12,9 @@ data you send to the child process may not be immediately consumed.)

To create a child process use `require('child_process').spawn()` or
`require('child_process').fork()`. The semantics of each are slightly
different, and explained [below](#child_process_asynchronous_process_creation).
different, and explained [below][].

For scripting purposes you may find the
[synchronous counterparts](#child_process_synchronous_process_creation) more
For scripting purposes you may find the [synchronous counterparts][] more
convenient.

## Class: ChildProcess
@@ -61,8 +60,7 @@ Note that the `exit`-event may or may not fire after an error has occurred. If
you are listening on both events to fire a function, remember to guard against
calling your function twice.

See also [`ChildProcess#kill()`](#child_process_child_kill_signal) and
[`ChildProcess#send()`](#child_process_child_send_message_sendhandle_callback).
See also [`ChildProcess#kill()`][] and [`ChildProcess#send()`][].

### Event: 'exit'

@@ -161,7 +159,7 @@ Example:
* `callback` {Function}
* Return: Boolean

When using [`child_process.fork()`](#child_process_child_process_fork_modulepath_args_options) you can write to the child using
When using [`child_process.fork()`][] you can write to the child using
`child.send(message[, sendHandle][, callback])` and messages are received by
a `'message'` event on the child.

@@ -309,9 +307,7 @@ to the same object, or null.
* {Array}

A sparse array of pipes to the child process, corresponding with positions in
the [stdio](#child_process_options_stdio) option to
[spawn](#child_process_child_process_spawn_command_args_options) that have been
set to `'pipe'`.
the [stdio][] option to [spawn][] that have been set to `'pipe'`.
Note that streams 0-2 are also available as ChildProcess.stdin,
ChildProcess.stdout, and ChildProcess.stderr, respectively.

@@ -438,9 +434,9 @@ the existing process and uses a shell to execute the command.*
* `stderr` {Buffer}
* Return: ChildProcess object

This is similar to [`child_process.exec()`](#child_process_child_process_exec_command_options_callback) except it does not execute a
This is similar to [`child_process.exec()`][] except it does not execute a
subshell but rather the specified file directly. This makes it slightly
leaner than [`child_process.exec()`](#child_process_child_process_exec_command_options_callback). It has the same options.
leaner than [`child_process.exec()`][]. It has the same options.


### child_process.fork(modulePath[, args][, options])
@@ -461,10 +457,10 @@ leaner than [`child_process.exec()`](#child_process_child_process_exec_command_o
* `gid` {Number} Sets the group identity of the process. (See setgid(2).)
* Return: ChildProcess object

This is a special case of the [`child_process.spawn()`](#child_process_child_process_spawn_command_args_options) functionality for spawning Node.js
processes. In addition to having all the methods in a normal ChildProcess
instance, the returned object has a communication channel built-in. See
[`child.send(message, [sendHandle])`](#child_process_child_send_message_sendhandle_callback) for details.
This is a special case of the [`child_process.spawn()`][] functionality for
spawning Node.js processes. In addition to having all the methods in a normal
ChildProcess instance, the returned object has a communication channel built-in.
See [`child.send(message, [sendHandle])`][] for details.

These child Node.js processes are still whole new instances of V8. Assume at
least 30ms startup and 10mb memory for each new Node.js. That is, you cannot
@@ -662,7 +658,7 @@ Example:
// startd-style interface.
spawn('prg', [], { stdio: ['pipe', null, null, null, 'pipe'] });

See also: [`child_process.exec()`](#child_process_child_process_exec_command_options_callback) and [`child_process.fork()`](#child_process_child_process_fork_modulepath_args_options)
See also: [`child_process.exec()`][] and [`child_process.fork()`][]

## Synchronous Process Creation

@@ -702,11 +698,7 @@ process has exited.

If the process times out, or has a non-zero exit code, this method ***will***
throw. The `Error` object will contain the entire result from
[`child_process.spawnSync()`](#child_process_child_process_spawnsync_command_args_options)

[EventEmitter]: events.html#events_class_events_eventemitter
[net.Server]: net.html#net_class_net_server
[net.Socket]: net.html#net_class_net_socket
[`child_process.spawnSync()`][]

### child_process.execSync(command[, options])

@@ -740,7 +732,7 @@ process has exited.

If the process times out, or has a non-zero exit code, this method ***will***
throw. The `Error` object will contain the entire result from
[`child_process.spawnSync()`](#child_process_child_process_spawnsync_command_args_options)
[`child_process.spawnSync()`][]

### child_process.spawnSync(command[, args][, options])

@@ -773,3 +765,18 @@ timeout has been encountered and `killSignal` is sent, the method won't return
until the process has completely exited. That is to say, if the process handles
the `SIGTERM` signal and doesn't exit, your process will wait until the child
process has exited.

[below]: #child_process_asynchronous_process_creation
[synchronous counterparts]: #child_process_synchronous_process_creation
[EventEmitter]: events.html#events_class_events_eventemitter
[`ChildProcess#kill()`]: #child_process_child_kill_signal
[`ChildProcess#send()`]: #child_process_child_send_message_sendhandle_callback
[net.Server]: net.html#net_class_net_server
[net.Socket]: net.html#net_class_net_socket
[`child_process.fork()`]: #child_process_child_process_fork_modulepath_args_options
[stdio]: #child_process_options_stdio
[spawn]: #child_process_child_process_spawn_command_args_options
[`child_process.exec()`]: #child_process_child_process_exec_command_options_callback
[`child_process.spawn()`]: #child_process_child_process_spawn_command_args_options
[`child.send(message, [sendHandle])`]: #child_process_child_send_message_sendhandle_callback
[`child_process.spawnSync()`]: #child_process_child_process_spawnsync_command_args_options
26 changes: 15 additions & 11 deletions doc/api/cluster.markdown
Original file line number Diff line number Diff line change
@@ -123,8 +123,6 @@ This event is the same as the one provided by `child_process.fork()`.

In a worker you can also use `process.on('error')`.

[ChildProcess.send()]: child_process.html#child_process_child_send_message_sendhandle_callback

### Event: 'exit'

* `code` {Number} the exit code, if it exited normally.
@@ -232,15 +230,15 @@ Causes `.suicide` to be set.
Note that after a server is closed, it will no longer accept new connections,
but connections may be accepted by any other listening worker. Existing
connections will be allowed to close as usual. When no more connections exist,
see [server.close()](net.html#net_event_close), the IPC channel to the worker
will close allowing it to die gracefully.
see [server.close()][], the IPC channel to the worker will close allowing it to
die gracefully.

The above applies *only* to server connections, client connections are not
automatically closed by workers, and disconnect does not wait for them to close
before exiting.

Note that in a worker, `process.disconnect` exists, but it is not this function,
it is [disconnect](child_process.html#child_process_child_disconnect).
it is [disconnect][].

Because long living server connections may block workers from disconnecting, it
may be useful to send a message, so application specific actions may be taken to
@@ -313,7 +311,7 @@ Causes `.suicide` to be set.
This method is aliased as `worker.destroy()` for backwards compatibility.

Note that in a worker, `process.kill()` exists, but it is not this function,
it is [kill](process.html#process_process_kill_pid_signal).
it is [kill][].

### worker.process

@@ -323,8 +321,7 @@ All workers are created using `child_process.fork()`, the returned object
from this function is stored as `.process`. In a worker, the global `process`
is stored.

See: [Child Process module](
child_process.html#child_process_child_process_fork_modulepath_args_options)
See: [Child Process module][]

Note that workers will call `process.exit(0)` if the `'disconnect'` event occurs
on `process` and `.suicide` is not `true`. This protects against accidental
@@ -408,7 +405,7 @@ This can be used to restart the worker by calling `.fork()` again.
cluster.fork();
});

See [child_process event: 'exit'](child_process.html#child_process_event_exit).
See [child_process event: 'exit'][].

## Event: 'fork'

@@ -464,8 +461,7 @@ The `addressType` is one of:

Emitted when any worker receives a message.

See
[child_process event: 'message'](child_process.html#child_process_event_message).
See [child_process event: 'message'][].

## Event: 'online'

@@ -647,3 +643,11 @@ the worker's unique id is the easiest way to find the worker.
socket.on('data', function(id) {
var worker = cluster.workers[id];
});

[server.close()]: net.html#net_event_close
[disconnect]: child_process.html#child_process_child_disconnect
[kill]: process.html#process_process_kill_pid_signal
[Child Process module]: child_process.html#child_process_child_process_fork_modulepath_args_options
[ChildProcess.send()]: child_process.html#child_process_child_send_message_sendhandle_callback
[child_process event: 'exit']: child_process.html#child_process_event_exit
[child_process event: 'message']: child_process.html#child_process_event_message.
14 changes: 8 additions & 6 deletions doc/api/console.markdown
Original file line number Diff line number Diff line change
@@ -43,10 +43,6 @@ The global `console` is a special `Console` whose output is sent to

new Console(process.stdout, process.stderr);

[assert.ok()]: assert.html#assert_assert_value_message_assert_ok_value_message
[util.format()]: util.html#util_util_format_format
[customizing util.inspect colors]: util.html#util_customizing_util_inspect_colors

## console

* {Object}
@@ -114,13 +110,13 @@ is used on each argument. See [util.format()][] for more information.
Used to calculate the duration of a specific operation. To start a timer, call
the `console.time()` method, giving it a name as only parameter. To stop the
timer, and to get the elapsed time in milliseconds, just call the
[`console.timeEnd()`](#console_console_timeend_label) method, again passing the
[`console.timeEnd()`][] method, again passing the
timer's name as the parameter.

### console.timeEnd(label)

Stops a timer that was previously started by calling
[`console.time()`](#console_console_time_label) and print the result to the
[`console.time()`][] and prints the result to the
console.

Example:
@@ -140,3 +136,9 @@ to the current position.
### console.warn([data][, ...])

Same as `console.error`.

[assert.ok()]: assert.html#assert_assert_value_message_assert_ok_value_message
[customizing util.inspect colors]: util.html#util_customizing_util_inspect_colors
[util.format()]: util.html#util_util_format_format
[`console.timeEnd()`]: #console_console_timeend_label
[`console.time()`]: #console_console_time_label
87 changes: 45 additions & 42 deletions doc/api/crypto.markdown
Original file line number Diff line number Diff line change
@@ -36,10 +36,10 @@ Class for encrypting data.

Returned by `crypto.createCipher` and `crypto.createCipheriv`.

Cipher objects are [streams](stream.html) that are both readable and
writable. The written plain text data is used to produce the
encrypted data on the readable side. The legacy `update` and `final`
methods are also supported.
Cipher objects are [streams][] that are both readable and writable.
The written plain text data is used to produce the encrypted data on
the readable side. The legacy `update` and `final` methods are also
supported.

### cipher.final([output_encoding])

@@ -91,10 +91,10 @@ Class for decrypting data.

Returned by `crypto.createDecipher` and `crypto.createDecipheriv`.

Decipher objects are [streams](stream.html) that are both readable and
writable. The written enciphered data is used to produce the
plain-text data on the the readable side. The legacy `update` and
`final` methods are also supported.
Decipher objects are [streams][] that are both readable and writable.
The written enciphered data is used to produce the plain-text data on
the the readable side. The legacy `update` and `final` methods are also
supported.

### decipher.final([output_encoding])

@@ -287,10 +287,10 @@ expected.

The class for creating hash digests of data.

It is a [stream](stream.html) that is both readable and writable. The
written data is used to compute the hash. Once the writable side of
the stream is ended, use the `read()` method to get the computed hash
digest. The legacy `update` and `digest` methods are also supported.
It is a [stream][] that is both readable and writable. The written data
is used to compute the hash. Once the writable side of the stream is ended,
use the `read()` method to get the computed hash digest. The legacy `update`
and `digest` methods are also supported.

Returned by `crypto.createHash`.

@@ -339,10 +339,10 @@ Class for generating signatures.

Returned by `crypto.createSign`.

Sign objects are writable [streams](stream.html). The written data is
used to generate the signature. Once all of the data has been
written, the `sign` method will return the signature. The legacy
`update` method is also supported.
Sign objects are writable [streams][]. The written data is used to
generate the signature. Once all of the data has been written, the
`sign` method will return the signature. The legacy `update` method
is also supported.

### sign.sign(private_key[, output_format])

@@ -375,11 +375,10 @@ Class for verifying signatures.

Returned by `crypto.createVerify`.

Verify objects are writable [streams](stream.html). The written data
is used to validate against the supplied signature. Once all of the
data has been written, the `verify` method will return true if the
supplied signature is valid. The legacy `update` method is also
supported.
Verify objects are writable [streams][]. The written data is used to
validate against the supplied signature. Once all of the data has been
written, the `verify` method will return true if the supplied signature
is valid. The legacy `update` method is also supported.

### verifier.update(data)

@@ -420,12 +419,12 @@ password.
`algorithm` is dependent on OpenSSL, examples are `'aes192'`, etc. On
recent releases, `openssl list-cipher-algorithms` will display the
available cipher algorithms. `password` is used to derive key and IV,
which must be a `'binary'` encoded string or a [buffer](buffer.html).
which must be a `'binary'` encoded string or a [buffer][].

It is a [stream](stream.html) that is both readable and writable. The
written data is used to compute the hash. Once the writable side of
the stream is ended, use the `read()` method to get the enciphered
contents. The legacy `update` and `final` methods are also supported.
It is a [stream][] that is both readable and writable. The written data
is used to compute the hash. Once the writable side of the stream is ended,
use the `read()` method to get the enciphered contents. The legacy `update`
and `final` methods are also supported.

Note: `createCipher` derives keys with the OpenSSL function [EVP_BytesToKey][]
with the digest algorithm set to MD5, one iteration, and no salt. The lack of
@@ -443,11 +442,9 @@ Creates and returns a cipher object, with the given algorithm, key and
iv.

`algorithm` is the same as the argument to `createCipher()`. `key` is
the raw key used by the algorithm. `iv` is an [initialization
vector](http://en.wikipedia.org/wiki/Initialization_vector).
the raw key used by the algorithm. `iv` is an [initialization vector][].

`key` and `iv` must be `'binary'` encoded strings or
[buffers](buffer.html).
`key` and `iv` must be `'binary'` encoded strings or [buffers][].

## crypto.createCredentials(details)

@@ -542,10 +539,10 @@ Example: this program that takes the sha256 sum of a file
Creates and returns a hmac object, a cryptographic hmac with the given
algorithm and key.

It is a [stream](stream.html) that is both readable and writable. The
written data is used to compute the hmac. Once the writable side of
the stream is ended, use the `read()` method to get the computed
digest. The legacy `update` and `digest` methods are also supported.
It is a [stream][] that is both readable and writable. The written
data is used to compute the hmac. Once the writable side of the
stream is ended, use the `read()` method to get the computed digest.
The legacy `update` and `digest` methods are also supported.

`algorithm` is dependent on the available algorithms supported by
OpenSSL - see createHash above. `key` is the hmac key to be used.
@@ -583,12 +580,12 @@ Example:

Creates a predefined Diffie-Hellman key exchange object. The
supported groups are: `'modp1'`, `'modp2'`, `'modp5'` (defined in
[RFC 2412][], but see [Caveats](#crypto_caveats)) and `'modp14'`,
`'modp15'`, `'modp16'`, `'modp17'`, `'modp18'` (defined in
[RFC 3526][]). The returned object mimics the interface of objects
created by [crypto.createDiffieHellman()][] above, but will not allow
changing the keys (with [diffieHellman.setPublicKey()][] for example).
The advantage of using this routine is that the parties do not have to
[RFC 2412][], but see [Caveats][]) and `'modp14'`, `'modp15'`,
`'modp16'`, `'modp17'`, `'modp18'` (defined in [RFC 3526][]). The
returned object mimics the interface of objects created by
[crypto.createDiffieHellman()][] above, but will not allow changing
the keys (with [diffieHellman.setPublicKey()][] for example). The
advantage of using this routine is that the parties do not have to
generate nor exchange group modulus beforehand, saving both processor
and communication time.

@@ -631,8 +628,7 @@ Example:
console.log(key.toString('hex')); // 'c5e478d...1469e50'
});

You can get a list of supported digest functions with
[crypto.getHashes()](#crypto_crypto_gethashes).
You can get a list of supported digest functions with [crypto.getHashes()][].

## crypto.pbkdf2Sync(password, salt, iterations, keylen[, digest])

@@ -779,6 +775,10 @@ Based on the recommendations of [NIST SP 800-131A]:

See the reference for other recommendations and details.

[stream]: stream.html
[streams]: stream.html
[buffer]: buffer.html
[buffers]: buffer.html
[createCipher()]: #crypto_crypto_createcipher_algorithm_password
[createCipheriv()]: #crypto_crypto_createcipheriv_algorithm_key_iv
[getCurves()]: #crypto_crypto_getcurves
@@ -790,3 +790,6 @@ See the reference for other recommendations and details.
[crypto.pbkdf2]: #crypto_crypto_pbkdf2_password_salt_iterations_keylen_digest_callback
[EVP_BytesToKey]: https://www.openssl.org/docs/crypto/EVP_BytesToKey.html
[NIST SP 800-131A]: http://csrc.nist.gov/publications/nistpubs/800-131A/sp800-131A.pdf
[initialization vector]: http://en.wikipedia.org/wiki/Initialization_vector
[Caveats]: #crypto_caveats
[crypto.getHashes()]: #crypto_crypto_gethashes
7 changes: 4 additions & 3 deletions doc/api/debugger.markdown
Original file line number Diff line number Diff line change
@@ -5,9 +5,8 @@
<!-- type=misc -->

V8 comes with an extensive debugger which is accessible out-of-process via a
simple [TCP protocol](http://code.google.com/p/v8/wiki/DebuggerProtocol).
Node.js has a built-in client for this debugger. To use this, start Node.js with
the `debug` argument; a prompt will appear:
simple [TCP protocol][]. Node.js has a built-in client for this debugger. To
use this, start Node.js with the `debug` argument; a prompt will appear:

% node debug myscript.js
< debugger listening on port 5858
@@ -168,3 +167,5 @@ debugger. The syntax is:

* `node debug -p <pid>` - Connects to the process via the `pid`
* `node debug <URI>` - Connects to the process via the URI such as localhost:5858

[TCP protocol]: http://code.google.com/p/v8/wiki/DebuggerProtocol
13 changes: 7 additions & 6 deletions doc/api/dgram.markdown
Original file line number Diff line number Diff line change
@@ -143,7 +143,7 @@ shown below.
### socket.close([callback])

Close the underlying socket and stop listening for data on it. If a callback is
provided, it is added as a listener for the ['close'](#dgram_event_close) event.
provided, it is added as a listener for the ['close'][] event.

### socket.dropMembership(multicastAddress[, multicastInterface])

@@ -186,9 +186,7 @@ given, the error will be the first argument to the callback. If a callback is
not given, the error is emitted as an `'error'` event on the `socket` object.

With consideration for multi-byte characters, `offset` and `length` will
be calculated with respect to
[byte length](buffer.html#buffer_class_method_buffer_bytelength_string_encoding)
and not the character position.
be calculated with respect to [byte length][] and not the character position.

Example of sending a UDP packet to a random port on `localhost`;

@@ -261,8 +259,8 @@ gateway that forwards a packet decrements the TTL. If the TTL is decremented to
router, it will not be forwarded. Changing TTL values is typically done for network
probes or when multicasting.

The argument to `setTTL()` is a number of hops between 1 and 255. The default on most
systems is 64.
The argument to `setTTL()` is a number of hops between 1 and 255. The default
on most systems is 64.

### socket.ref()

@@ -315,3 +313,6 @@ Call `socket.bind()` if you want to receive datagrams. `socket.bind()` will
bind to the "all interfaces" address on a random port (it does the right thing
for both `udp4` and `udp6` sockets). You can then retrieve the address and port
with `socket.address().address` and `socket.address().port`.

['close']: #dgram_event_close
[byte length]: buffer.html#buffer_class_method_buffer_bytelength_string_encoding
41 changes: 22 additions & 19 deletions doc/api/dns.markdown
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ This module contains functions that belong to two different categories:
name resolution, and that do not necessarily do any network communication.
This category contains only one function: `dns.lookup()`. __Developers looking
to perform name resolution in the same way that other applications on the same
operating system behave should use [`dns.lookup()`][dns.lookup].__
operating system behave should use [`dns.lookup()`][].__

Here is an example that does a lookup of `www.google.com`.

@@ -22,8 +22,8 @@ Here is an example that does a lookup of `www.google.com`.

2) Functions that connect to an actual DNS server to perform name resolution,
and that _always_ use the network to perform DNS queries. This category
contains all functions in the `dns` module but [`dns.lookup()`][dns.lookup]. These functions
do not use the same set of configuration files than what [`dns.lookup()`][dns.lookup] uses.
contains all functions in the `dns` module but [`dns.lookup()`][]. These functions
do not use the same set of configuration files than what [`dns.lookup()`][] uses.
For instance, _they do not use the configuration from `/etc/hosts`_. These
functions should be used by developers who do not want to use the underlying
operating system's facilities for name resolution, and instead want to
@@ -51,8 +51,7 @@ resolves the IP addresses which are returned.
});

There are subtle consequences in choosing one or another, please consult the
[Implementation considerations section](#dns_implementation_considerations)
for more information.
[Implementation considerations section][] for more information.

## dns.getServers()

@@ -74,8 +73,8 @@ Alternatively, `options` can be an object containing these properties:
`getaddrinfo` flags. If `hints` is not provided, then no flags are passed to
`getaddrinfo`. Multiple flags can be passed through `hints` by logically
`OR`ing their values.
See [supported `getaddrinfo` flags](#dns_supported_getaddrinfo_flags) below
for more information on supported flags.
See [supported `getaddrinfo` flags][] below for more information on supported
flags.
* `all`: {Boolean} - When `true`, the callback returns all resolved addresses
in an array, otherwise returns a single address. Defaults to `false`.

@@ -109,7 +108,7 @@ and vice versa.

Its implementation can have subtle but important consequences on the behavior
of any Node.js program. Please take some time to consult the [Implementation
considerations section](#dns_implementation_considerations) before using it.
considerations section][] before using it.

## dns.lookupService(address, port, callback)

@@ -149,36 +148,36 @@ one of the error codes listed below.

## dns.resolve4(hostname, callback)

The same as [`dns.resolve()`](#dns_dns_resolve_hostname_rrtype_callback), but only for IPv4 queries (`A` records).
The same as [`dns.resolve()`][], but only for IPv4 queries (`A` records).
`addresses` is an array of IPv4 addresses (e.g.
`['74.125.79.104', '74.125.79.105', '74.125.79.106']`).

## dns.resolve6(hostname, callback)

The same as [`dns.resolve4()`](#dns_dns_resolve4_hostname_callback) except for IPv6 queries (an `AAAA` query).
The same as [`dns.resolve4()`][] except for IPv6 queries (an `AAAA` query).

## dns.resolveCname(hostname, callback)

The same as [`dns.resolve()`](#dns_dns_resolve_hostname_rrtype_callback), but only for canonical name records (`CNAME`
The same as [`dns.resolve()`][], but only for canonical name records (`CNAME`
records). `addresses` is an array of the canonical name records available for
`hostname` (e.g., `['bar.example.com']`).

## dns.resolveMx(hostname, callback)

The same as [`dns.resolve()`](#dns_dns_resolve_hostname_rrtype_callback), but only for mail exchange queries (`MX` records).
The same as [`dns.resolve()`][], but only for mail exchange queries (`MX` records).

`addresses` is an array of MX records, each with a priority and an exchange
attribute (e.g. `[{'priority': 10, 'exchange': 'mx.example.com'},...]`).

## dns.resolveNs(hostname, callback)

The same as [`dns.resolve()`](#dns_dns_resolve_hostname_rrtype_callback), but only for name server records (`NS` records).
The same as [`dns.resolve()`][], but only for name server records (`NS` records).
`addresses` is an array of the name server records available for `hostname`
(e.g., `['ns1.example.com', 'ns2.example.com']`).

## dns.resolveSoa(hostname, callback)

The same as [`dns.resolve()`](#dns_dns_resolve_hostname_rrtype_callback), but only for start of authority record queries
The same as [`dns.resolve()`][], but only for start of authority record queries
(`SOA` record).

`addresses` is an object with the following structure:
@@ -197,14 +196,14 @@ The same as [`dns.resolve()`](#dns_dns_resolve_hostname_rrtype_callback), but on

## dns.resolveSrv(hostname, callback)

The same as [`dns.resolve()`](#dns_dns_resolve_hostname_rrtype_callback), but only for service records (`SRV` records).
The same as [`dns.resolve()`][], but only for service records (`SRV` records).
`addresses` is an array of the SRV records available for `hostname`. Properties
of SRV records are priority, weight, port, and name (e.g.,
`[{'priority': 10, 'weight': 5, 'port': 21223, 'name': 'service.example.com'}, ...]`).

## dns.resolveTxt(hostname, callback)

The same as [`dns.resolve()`](#dns_dns_resolve_hostname_rrtype_callback), but only for text queries (`TXT` records).
The same as [`dns.resolve()`][], but only for text queries (`TXT` records).
`addresses` is a 2-d array of the text records available for `hostname` (e.g.,
`[ ['v=spf1 ip4:0.0.0.0 ', '~all' ] ]`). Each sub-array contains TXT chunks of
one record. Depending on the use case, the could be either joined together or
@@ -296,8 +295,7 @@ operations) will experience degraded performance. In order to mitigate this
issue, one potential solution is to increase the size of libuv's threadpool by
setting the 'UV_THREADPOOL_SIZE' environment variable to a value greater than
4 (its current default value). For more information on libuv's threadpool, see
[the official libuv
documentation](http://docs.libuv.org/en/latest/threadpool.html).
[the official libuv documentation][].

### dns.resolve, functions starting with dns.resolve and dns.reverse

@@ -312,5 +310,10 @@ processing that happens on libuv's threadpool that `dns.lookup()` can have.
They do not use the same set of configuration files than what `dns.lookup()`
uses. For instance, _they do not use the configuration from `/etc/hosts`_.

[Implementation considerations section]: #dns_implementation_considerations
[supported `getaddrinfo` flags]: #dns_supported_getaddrinfo_flags
[`dns.resolve()`]: #dns_dns_resolve_hostname_rrtype_callback
[`dns.resolve4()`]: #dns_dns_resolve4_hostname_callback
[the official libuv documentation]: http://docs.libuv.org/en/latest/threadpool.html
[`dns.lookup()`]: #dns_dns_lookup_hostname_options_callback

[dns.lookup]: #dns_dns_lookup_hostname_options_callback
65 changes: 41 additions & 24 deletions doc/api/errors.markdown
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
<!--type=misc-->

Errors generated by Node.js fall into two categories: JavaScript errors and system
errors. All errors inherit from or are instances of JavaScript's [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error)
errors. All errors inherit from or are instances of JavaScript's [Error][]
class and are guaranteed to provide *at least* the attributes available on that
class.

@@ -16,7 +16,7 @@ opportunity to **intercept** this error based on how the API **propagates** it.
The style of API called determines how generated errors are handed back, or
**propagated**, to client code, which in turn informs how the client may **intercept**
the error. Exceptions can be intercepted using the `try / catch` construct;
other propagation strategies are covered [below](#errors_error_propagation_and_interception).
other propagation strategies are covered [below][].

## Error Propagation and Interception

@@ -26,11 +26,9 @@ All Node.js APIs will treat invalid arguments as exceptional -- that is, if pass
invalid arguments, they will *immediately* generate and throw the error as an
exception, even if they are an otherwise asynchronous API.

Synchronous APIs (like
[fs.readFileSync](fs.html#fs_fs_readfilesync_filename_options)) will throw the
error. The act of *throwing* a value (in this case, the error) turns the value
into an **exception**. Exceptions may be caught using the `try { } catch(err)
{ }` construct.
Synchronous APIs (like [fs.readFileSync][]) will throw the error. The act of
*throwing* a value (in this case, the error) turns the value into an **exception**.
Exceptions may be caught using the `try { } catch(err) { }` construct.

Asynchronous APIs have **two** mechanisms for error propagation; one mechanism
for APIs that represent a single operation, and one for APIs that represent
@@ -41,12 +39,12 @@ multiple operations over time.
<!--type=misc-->

The other mechanism for providing errors is the "error" event. This is
typically used by [stream-based](stream.html) and [event emitter-based](events.html#events_class_events_eventemitter) APIs, which
typically used by [stream-based][] and [event emitter-based][] APIs, which
themselves represent a series of asynchronous operations over time (versus a
single operation that may pass or fail). If no "error" event handler is
attached to the source of the error, the error will be thrown. At this point,
it will crash the process as an unhandled exception unless [domains](domain.html) are
employed appropriately or [process.on('uncaughtException')](process.html#process_event_uncaughtexception) has a handler.
it will crash the process as an unhandled exception unless [domains][] are
employed appropriately or [process.on('uncaughtException')][] has a handler.

```javascript
var net = require('net');
@@ -131,7 +129,7 @@ try {
This will not work! By the time the node style callback has been called, the
surrounding code (including the `try { } catch(err) { }` will have already
exited. Throwing an error inside a node style callback **will crash the process** in most cases.
If [domains](domain.html) are enabled, they may intercept the thrown error; similarly, if a
If [domains][] are enabled, they may intercept the thrown error; similarly, if a
handler has been added to `process.on('uncaughtException')`, it will intercept
the error.

@@ -158,7 +156,7 @@ errors as well as plain JavaScript errors.

Instantiates a new Error object and sets its `.message` property to the provided
message. Its `.stack` will represent the point in the program at which `new Error`
was called. Stack traces are subject to [V8's stack trace API](https://code.google.com/p/v8-wiki/wiki/JavaScriptStackTraceApi).
was called. Stack traces are subject to [V8's stack trace API][].
Stack traces only extend to the beginning of synchronous code execution, *or* a number of frames given by
`Error.stackTraceLimit`, whichever is smaller.

@@ -328,7 +326,7 @@ dependencies.
A subclass of Error that indicates that a program is not valid JavaScript.
These errors may only be generated and propagated as a result of code
evaluation. Code evaluation may happen as a result of `eval`, `Function`,
`require`, or [vm](vm.html). These errors are almost always indicative of a broken
`require`, or [vm][]. These errors are almost always indicative of a broken
program.

```javascript
@@ -372,7 +370,7 @@ System errors are generated in response to a program's runtime environment.
Ideally, they represent operational errors that the program needs to be able to
react to. They are generated at the syscall level: an exhaustive list of error
codes and their meanings is available by running `man 2 intro` or `man 3 errno`
on most Unices; or [online](http://man7.org/linux/man-pages/man3/errno.3.html).
on most Unices; or [online][].

In Node.js, system errors are represented as augmented Error objects -- not full
subclasses, but instead an error instance with added members.
@@ -387,12 +385,12 @@ letters, and may be referenced in `man 2 intro`.

#### error.syscall

A string representing the [syscall](http://man7.org/linux/man-pages/man2/syscall.2.html) that failed.
A string representing the [syscall][] that failed.

### Common System Errors

This list is **not exhaustive**, but enumerates many of the common system errors when
writing a Node.js program. An exhaustive list may be found [here](http://man7.org/linux/man-pages/man3/errno.3.html).
writing a Node.js program. An exhaustive list may be found [here][online].

#### EACCES: Permission denied

@@ -401,7 +399,7 @@ permissions.

#### EADDRINUSE: Address already in use

An attempt to bind a server ([net](net.html), [http](http.html), or [https](https.html)) to a local
An attempt to bind a server ([net][], [http][], or [https][]) to a local
address failed due to another server on the local system already occupying
that address.

@@ -415,7 +413,7 @@ on the foreign host.

A connection was forcibly closed by a peer. This normally results
from a loss of the connection on the remote socket due to a timeout
or reboot. Commonly encountered via the [http](http.html) and [net](net.html) modules.
or reboot. Commonly encountered via the [http][] and [net][] modules.

#### EEXIST: File exists

@@ -428,7 +426,7 @@ An operation expected a file, but the given pathname was a directory.

#### EMFILE: Too many open files in system

Maximum number of [file descriptors](http://en.wikipedia.org/wiki/File_descriptor) allowable on the system has
Maximum number of [file descriptors][] allowable on the system has
been reached, and requests for another descriptor cannot be fulfilled until
at least one has been closed.

@@ -439,18 +437,18 @@ that will run the Node.js process.

#### ENOENT: No such file or directory

Commonly raised by [fs](fs.html) operations; a component of the specified pathname
Commonly raised by [fs][] operations; a component of the specified pathname
does not exist -- no entity (file or directory) could be found by the given path.

#### ENOTDIR: Not a directory

A component of the given pathname existed, but was not a directory as expected.
Commonly raised by [fs.readdir](fs.html#fs_fs_readdir_path_callback).
Commonly raised by [fs.readdir][].

#### ENOTEMPTY: Directory not empty

A directory with entries was the target of an operation that requires
an empty directory -- usually [fs.unlink](fs.html#fs_fs_unlink_path_callback).
an empty directory -- usually [fs.unlink][].

#### EPERM: Operation not permitted

@@ -460,11 +458,30 @@ privileges.
#### EPIPE: Broken pipe

A write on a pipe, socket, or FIFO for which there is no process to read the
data. Commonly encountered at the [net](net.html) and [http](http.html) layers, indicative that
data. Commonly encountered at the [net][] and [http][] layers, indicative that
the remote side of the stream being written to has been closed.

#### ETIMEDOUT: Operation timed out

A connect or send request failed because the connected party did not properly
respond after a period of time. Usually encountered by [http](http.html) or [net](net.html) --
respond after a period of time. Usually encountered by [http][] or [net][] --
often a sign that a connected socket was not `.end()`'d appropriately.

[Error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
[below]: #errors_error_propagation_and_interception
[fs.readFileSync]: fs.html#fs_fs_readfilesync_filename_options
[stream-based]: stream.html
[event emitter-based]: events.html#events_class_events_eventemitter
[domains]: domain.html
[process.on('uncaughtException')]: process.html#process_event_uncaughtexception
[V8's stack trace API]: https://code.google.com/p/v8-wiki/wiki/JavaScriptStackTraceApi
[vm]: vm.html
[online]: http://man7.org/linux/man-pages/man3/errno.3.html
[syscall]: http://man7.org/linux/man-pages/man2/syscall.2.html
[net]: net.html
[http]: http.html
[https]: https.html
[file descriptors]: http://en.wikipedia.org/wiki/File_descriptor
[fs]: fs.html
[fs.readdir]: fs.html#fs_fs_readdir_path_callback
[fs.unlink]: fs.html#fs_fs_unlink_path_callback
23 changes: 12 additions & 11 deletions doc/api/events.markdown
Original file line number Diff line number Diff line change
@@ -4,11 +4,9 @@

<!--type=module-->

Many objects in Node.js emit events: a
[`net.Server`](net.html#net_class_net_server) emits an event each time a peer
connects to it, a [`fs.ReadStream`](fs.html#fs_class_fs_readstream) emits an
event when the file is
opened. All objects which emit events are instances of `events.EventEmitter`.
Many objects in Node.js emit events: a [`net.Server`][] emits an event each
time a peer connects to it, a [`fs.ReadStream`][] emits an event when the file
is opened. All objects which emit events are instances of `events.EventEmitter`.
You can access this module by doing: `require("events");`

Typically, event names are represented by a camel-cased string, however,
@@ -81,13 +79,12 @@ triggered, the listener has been removed from the array of listeners for the

### EventEmitter.defaultMaxListeners

[`emitter.setMaxListeners(n)`](#events_emitter_setmaxlisteners_n) sets the
maximum on a per-instance basis.
[`emitter.setMaxListeners(n)`][] sets the maximum on a per-instance basis.
This class property lets you set it for *all* `EventEmitter` instances,
current and future, effective immediately. Use with care.

Note that [`emitter.setMaxListeners(n)`](#events_emitter_setmaxlisteners_n)
still has precedence over `EventEmitter.defaultMaxListeners`.
Note that [`emitter.setMaxListeners(n)`][] still has precedence over
`EventEmitter.defaultMaxListeners`.

### emitter.addListener(event, listener)

@@ -102,8 +99,8 @@ Returns `true` if event had listeners, `false` otherwise.
### emitter.getMaxListeners()

Returns the current max listener value for the emitter which is either set by
[`emitter.setMaxListeners(n)`](#events_emitter_setmaxlisteners_n) or defaults to
[`EventEmitter.defaultMaxListeners`](#events_eventemitter_defaultmaxlisteners).
[`emitter.setMaxListeners(n)`][] or defaults to
[`EventEmitter.defaultMaxListeners`][].

This can be useful to increment/decrement max listeners to avoid the warning
while not being irresponsible and setting a too big number.
@@ -190,4 +187,8 @@ allows that to be increased. Set to `Infinity` (or `0`) for unlimited.

Returns emitter, so calls can be chained.

[`net.Server`]: net.html#net_class_net_server
[`fs.ReadStream`]: fs.html#fs_class_fs_readstream
[`emitter.setMaxListeners(n)`]: #events_emitter_setmaxlisteners_n
[`EventEmitter.defaultMaxListeners`]: #events_eventemitter_defaultmaxlisteners
[emitter.listenerCount]: #events_emitter_listenercount_type
29 changes: 17 additions & 12 deletions doc/api/fs.markdown
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@ Objects returned from `fs.watch()` are of this type.
* `filename` {String} The filename that changed (if relevant/available)

Emitted when something changes in a watched directory or file.
See more details in [fs.watch](#fs_fs_watch_filename_options_listener).
See more details in [fs.watch][].

### Event: 'error'

@@ -108,7 +108,7 @@ Stop watching for changes on the given `fs.FSWatcher`.

## Class: fs.ReadStream

`ReadStream` is a [Readable Stream](stream.html#stream_class_stream_readable).
`ReadStream` is a [Readable Stream][].

### Event: 'open'

@@ -157,9 +157,6 @@ additional methods which can be used for displaying fuzzy information.
More details can be found in the [MDN JavaScript Reference][MDN-Date]
page.

[MDN-Date]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date
[MDN-Date-getTime]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/getTime

### Stat Time Values

The times in the stat object have the following semantics:
@@ -186,7 +183,7 @@ on Unix systems, it never was.

## Class: fs.WriteStream

`WriteStream` is a [Writable Stream](stream.html#stream_class_stream_writable).
`WriteStream` is a [Writable Stream][].

### Event: 'open'

@@ -367,7 +364,7 @@ non-existent.

## fs.existsSync(path)

Synchronous version of [`fs.exists`](fs.html#fs_fs_exists_path_callback).
Synchronous version of [`fs.exists`][].
Returns `true` if the file exists, `false` otherwise.

Stability: 0 - Deprecated: Use [fs.statSync][] or [fs.accessSync][] instead.
@@ -652,8 +649,8 @@ Synchronous rmdir(2). Returns `undefined`.
## fs.stat(path, callback)

Asynchronous stat(2). The callback gets two arguments `(err, stats)` where
`stats` is a [fs.Stats](#fs_class_fs_stats) object. See the [fs.Stats](#fs_class_fs_stats)
section below for more information.
`stats` is a [fs.Stats][] object. See the [fs.Stats][] section below for more
information.

## fs.statSync(path)

@@ -723,7 +720,7 @@ Synchronous version of `fs.utimes()`. Returns `undefined`.
## fs.watch(filename[, options][, listener])

Watch for changes on `filename`, where `filename` is either a file or a
directory. The returned object is a [fs.FSWatcher](#fs_class_fs_fswatcher).
directory. The returned object is a [fs.FSWatcher][].

The second argument is optional. The `options` if provided should be an object.
The supported boolean members are `persistent` and `recursive`. `persistent`
@@ -855,8 +852,7 @@ the current position. See pwrite(2).

The callback will receive the arguments `(err, written, string)` where `written`
specifies how many _bytes_ the passed string required to be written. Note that
bytes written is not the same as string characters. See
[Buffer.byteLength](buffer.html#buffer_class_method_buffer_bytelength_string_encoding).
bytes written is not the same as string characters. See [Buffer.byteLength][].

Unlike when writing `buffer`, the entire string must be written. No substring
may be specified. This is because the byte offset of the resulting data may not
@@ -915,8 +911,17 @@ The synchronous version of `fs.writeFile`. Returns `undefined`.

Synchronous versions of `fs.write()`. Returns the number of bytes written.

[fs.watch]: #fs_fs_watch_filename_options_listener
[Readable Stream]: stream.html#stream_class_stream_readable
[MDN-Date]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date
[MDN-Date-getTime]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/getTime
[Writable Stream]: stream.html#stream_class_stream_writable
[fs.stat]: #fs_fs_stat_path_callback
[`fs.exists`]: fs.html#fs_fs_exists_path_callback
[fs.access]: #fs_fs_access_path_mode_callback
[fs.statSync]: #fs_fs_statsync_path
[fs.accessSync]: #fs_fs_accesssync_path_mode
[fs.Stats]: #fs_class_fs_stats
[Buffer]: buffer.html#buffer_buffer
[fs.FSWatcher]: #fs_class_fs_fswatcher
[Buffer.byteLength]: buffer.html#buffer_class_method_buffer_bytelength_string_encoding
14 changes: 7 additions & 7 deletions doc/api/globals.markdown
Original file line number Diff line number Diff line change
@@ -55,13 +55,6 @@ will not execute.

The timer functions are global variables. See the [timers][] section.

[buffer section]: buffer.html
[module system documentation]: modules.html
[Modules]: modules.html#modules_modules
[process object]: process.html#process_process
[console]: console.html
[timers]: timers.html

## clearTimeout(t)

Stop a timer that was previously created with `setTimeout()`. The callback will
@@ -185,3 +178,10 @@ outside that range, it's changed to 1 millisecond. Broadly speaking, a timer
cannot span more than 24.8 days.

Returns an opaque value that represents the timer.

[buffer section]: buffer.html
[module system documentation]: modules.html
[Modules]: modules.html#modules_modules
[process object]: process.html#process_process
[console]: console.html
[timers]: timers.html
22 changes: 12 additions & 10 deletions doc/api/http.markdown
Original file line number Diff line number Diff line change
@@ -56,13 +56,12 @@ require developers to manually close the HTTP clients using
KeepAlive.

If you opt into using HTTP KeepAlive, you can create an Agent object
with that flag set to `true`. (See the [constructor
options](#http_new_agent_options) below.) Then, the Agent will keep
unused sockets in a pool for later use. They will be explicitly
marked so as to not keep the Node.js process running. However, it is
still a good idea to explicitly [`destroy()`](#http_agent_destroy)
KeepAlive agents when they are no longer in use, so that the Sockets
will be shut down.
with that flag set to `true`. (See the [constructor options][] below.)
Then, the Agent will keep unused sockets in a pool for later use. They
will be explicitly marked so as to not keep the Node.js process running.
However, it is still a good idea to explicitly [`destroy()`][] KeepAlive
agents when they are no longer in use, so that the Sockets will be shut
down.

Sockets are removed from the agent's pool when the socket emits either
a "close" event or a special "agentRemove" event. This means that if
@@ -506,8 +505,7 @@ already been bound to a port or domain socket.
Listening on a file descriptor is not supported on Windows.

This function is asynchronous. The last parameter `callback` will be added as
a listener for the ['listening'](net.html#net_event_listening) event.
See also [net.Server.listen()](net.html#net_server_listen_handle_callback).
a listener for the ['listening'][] event. See also [net.Server.listen()][].

### server.listen(path[, callback])

@@ -958,7 +956,7 @@ connected to.

## http.createServer([requestListener])

Returns a new instance of [http.Server](#http_class_http_server).
Returns a new instance of [http.Server][].

The `requestListener` is a function which is automatically
added to the `'request'` event.
@@ -1085,6 +1083,8 @@ There are a few special headers that should be noted.
* Sending an Authorization header will override using the `auth` option
to compute basic authentication.

[constructor options]: #http_new_agent_options
[`destroy()`]: #http_agent_destroy
['checkContinue']: #http_event_checkcontinue
['listening']: net.html#net_event_listening
['response']: #http_event_response
@@ -1100,8 +1100,10 @@ There are a few special headers that should be noted.
[http.Server]: #http_class_http_server
[http.request]: #http_http_request_options_callback
[net.Server.close()]: net.html#net_server_close_callback
['listening']: net.html#net_event_listening
[net.Server.listen(path)]: net.html#net_server_listen_path_callback
[net.Server.listen(port)]: net.html#net_server_listen_port_hostname_backlog_callback
[net.Server.listen()]: net.html#net_server_listen_handle_callback
[response.end()]: #http_response_end_data_encoding_callback
[response.write()]: #http_response_write_chunk_encoding_callback
[response.writeContinue()]: #http_response_writecontinue
33 changes: 17 additions & 16 deletions doc/api/https.markdown
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ See [http.listen()][] for details.
Like `http.get()` but for HTTPS.

`options` can be an object or a string. If `options` is a string, it is
automatically parsed with [url.parse()](url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost).
automatically parsed with [url.parse()][].

Example:

@@ -96,26 +96,12 @@ Example:

Global instance of [https.Agent][] for all HTTPS client requests.

[http.Server#setTimeout()]: http.html#http_server_settimeout_msecs_callback
[http.Server#timeout]: http.html#http_server_timeout
[Agent]: #https_class_https_agent
[globalAgent]: #https_https_globalagent
[http.listen()]: http.html#http_server_listen_port_hostname_backlog_callback
[http.close()]: http.html#http_server_close_callback
[http.Agent]: http.html#http_class_http_agent
[http.request()]: http.html#http_http_request_options_callback
[https.Agent]: #https_class_https_agent
[https.request()]: #https_https_request_options_callback
[tls.connect()]: tls.html#tls_tls_connect_options_callback
[tls.createServer()]: tls.html#tls_tls_createserver_options_secureconnectionlistener
[SSL_METHODS]: http://www.openssl.org/docs/ssl/ssl.html#DEALING_WITH_PROTOCOL_METHODS

## https.request(options, callback)

Makes a request to a secure web server.

`options` can be an object or a string. If `options` is a string, it is
automatically parsed with [url.parse()](url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost).
automatically parsed with [url.parse()][].

All options from [http.request()][] are valid.

@@ -226,3 +212,18 @@ Example:
var req = https.request(options, function(res) {
...
}

[http.Server#setTimeout()]: http.html#http_server_settimeout_msecs_callback
[http.Server#timeout]: http.html#http_server_timeout
[Agent]: #https_class_https_agent
[globalAgent]: #https_https_globalagent
[http.listen()]: http.html#http_server_listen_port_hostname_backlog_callback
[url.parse()]: url.html#url_url_parse_urlstr_parsequerystring_slashesdenotehost
[http.close()]: http.html#http_server_close_callback
[http.Agent]: http.html#http_class_http_agent
[http.request()]: http.html#http_http_request_options_callback
[https.Agent]: #https_class_https_agent
[https.request()]: #https_https_request_options_callback
[tls.connect()]: tls.html#tls_tls_connect_options_callback
[tls.createServer()]: tls.html#tls_tls_createserver_options_secureconnectionlistener
[SSL_METHODS]: http://www.openssl.org/docs/ssl/ssl.html#DEALING_WITH_PROTOCOL_METHODS
6 changes: 3 additions & 3 deletions doc/api/modules.markdown
Original file line number Diff line number Diff line change
@@ -372,9 +372,7 @@ are not found elsewhere. (Note: On Windows, `NODE_PATH` is delimited by
semicolons instead of colons.)

`NODE_PATH` was originally created to support loading modules from
varying paths before the current
[module resolution](https://nodejs.org/api/modules.html#modules_all_together)
algorithm was frozen.
varying paths before the current [module resolution][] algorithm was frozen.

`NODE_PATH` is still supported, but is less necessary now that the Node.js
ecosystem has settled on a convention for locating dependent modules.
@@ -519,3 +517,5 @@ Note that in order to do this, you must get a reference to the `module`
object. Since `require()` returns the `module.exports`, and the `module` is
typically *only* available within a specific module's code, it must be
explicitly exported in order to be used.

[module resolution]: https://nodejs.org/api/modules.html#modules_all_together
40 changes: 18 additions & 22 deletions doc/api/net.markdown
Original file line number Diff line number Diff line change
@@ -493,12 +493,11 @@ written out - this may not be immediately.

## net.connect(options[, connectListener])

A factory function, which returns a new ['net.Socket'](#net_class_net_socket)
and automatically connects with the supplied `options`.
A factory function, which returns a new ['net.Socket'][] and automatically
connects with the supplied `options`.

The options are passed to both the ['net.Socket'](#net_class_net_socket)
constructor and the ['socket.connect'](#net_socket_connect_options_connectlistener)
method.
The options are passed to both the ['net.Socket'][] constructor and the
['socket.connect'][] method.

The `connectListener` parameter will be added as a listener for the
['connect'][] event once.
@@ -526,18 +525,16 @@ changed to

## net.connect(path[, connectListener])

A factory function, which returns a new unix
['net.Socket'](#net_class_net_socket) and automatically connects to the
supplied `path`.
A factory function, which returns a new unix ['net.Socket'][] and automatically
connects to the supplied `path`.

The `connectListener` parameter will be added as a listener for the
['connect'][] event once.

## net.connect(port[, host][, connectListener])

A factory function, which returns a new
['net.Socket'](#net_class_net_socket) and automatically connects to the
supplied `port` and `host`.
A factory function, which returns a new ['net.Socket'][] and automatically
connects to the supplied `port` and `host`.

If `host` is omitted, `'localhost'` will be assumed.

@@ -546,12 +543,11 @@ The `connectListener` parameter will be added as a listener for the

## net.createConnection(options[, connectListener])

A factory function, which returns a new ['net.Socket'](#net_class_net_socket)
and automatically connects with the supplied `options`.
A factory function, which returns a new ['net.Socket'][] and automatically
connects with the supplied `options`.

The options are passed to both the ['net.Socket'](#net_class_net_socket)
constructor and the ['socket.connect'](#net_socket_connect_options_connectlistener)
method.
The options are passed to both the ['net.Socket'][] constructor and the
['socket.connect'][] method.

The `connectListener` parameter will be added as a listener for the
['connect'][] event once.
@@ -579,18 +575,16 @@ changed to

## net.createConnection(path[, connectListener])

A factory function, which returns a new unix
['net.Socket'](#net_class_net_socket) and automatically connects to the
supplied `path`.
A factory function, which returns a new unix ['net.Socket'][] and automatically
connects to the supplied `path`.

The `connectListener` parameter will be added as a listener for the
['connect'][] event once.

## net.createConnection(port[, host][, connectListener])

A factory function, which returns a new
['net.Socket'](#net_class_net_socket) and automatically connects to the
supplied `port` and `host`.
A factory function, which returns a new ['net.Socket'][] and automatically
connects to the supplied `port` and `host`.

If `host` is omitted, `'localhost'` will be assumed.

@@ -672,4 +666,6 @@ Returns true if input is a version 6 IP address, otherwise returns false.
[server.getConnections]: #net_server_getconnections_callback
[Readable Stream]: stream.html#stream_class_stream_readable
[stream.setEncoding()]: stream.html#stream_readable_setencoding_encoding
['net.Socket']: #net_class_net_socket
[dns.lookup()]: dns.html#dns_dns_lookup_hostname_options_callback
['socket.connect']: #net_socket_connect_options_connectlistener
32 changes: 16 additions & 16 deletions doc/api/process.markdown
Original file line number Diff line number Diff line change
@@ -357,8 +357,7 @@ Returns the current working directory of the process.
Close the IPC channel to the parent process, allowing this child to exit
gracefully once there are no other connections keeping it alive.

Identical to the parent process's
[ChildProcess.disconnect()](child_process.html#child_process_child_disconnect).
Identical to the parent process's [ChildProcess.disconnect()][].

If Node.js was not spawned with an IPC channel, `process.disconnect()` will be
undefined.
@@ -545,7 +544,7 @@ Some care needs to be taken when dropping privileges. Example:
Send a signal to a process. `pid` is the process id and `signal` is the
string describing the signal to send. Signal names are strings like
'SIGINT' or 'SIGHUP'. If omitted, the signal will be 'SIGTERM'.
See [Signal Events](#process_signal_events) and kill(2) for more information.
See [Signal Events][] and kill(2) for more information.

Will throw an error if target does not exist, and as a special case, a signal
of `0` can be used to test for the existence of a process.
@@ -568,16 +567,14 @@ Example of sending a signal to yourself:
process.kill(process.pid, 'SIGHUP');

Note: When SIGUSR1 is received by Node.js it starts the debugger, see
[Signal Events](#process_signal_events).
[Signal Events][].

## process.mainModule

Alternate way to retrieve
[`require.main`](modules.html#modules_accessing_the_main_module).
The difference is that if the main module changes at runtime, `require.main`
might still refer to the original main module in modules that were required
before the change occurred. Generally it's safe to assume that the two refer
to the same module.
Alternate way to retrieve [`require.main`][]. The difference is that if the main
module changes at runtime, `require.main` might still refer to the original main
module in modules that were required before the change occurred. Generally it's
safe to assume that the two refer to the same module.

As with `require.main`, it will be `undefined` if there was no entry script.

@@ -726,8 +723,7 @@ relied upon to exist.

When Node.js is spawned with an IPC channel attached, it can send messages to its
parent process using `process.send()`. Each will be received as a
['message'](child_process.html#child_process_event_message)
event on the parent's `ChildProcess` object.
['message'][] event on the parent's `ChildProcess` object.

If Node.js was not spawned with an IPC channel, `process.send()` will be undefined.

@@ -852,8 +848,7 @@ Example of opening standard input and listening for both events:

As a Stream, `process.stdin` can also be used in "old" mode that is compatible
with scripts written for node.js prior to v0.10.
For more information see
[Stream compatibility](stream.html#stream_compatibility_with_older_node_js_versions).
For more information see [Stream compatibility][].

In "old" Streams mode the stdin stream is paused by default, so one
must call `process.stdin.resume()` to read from it. Note also that calling
@@ -891,7 +886,7 @@ on `process.stderr`, `process.stdout`, or `process.stdin`:
$ node -p "Boolean(process.stdout.isTTY)" | cat
false

See [the tty docs](tty.html#tty_tty) for more information.
See [the tty docs][] for more information.

## process.title

@@ -948,8 +943,13 @@ Will print something like:
icu: '55.1',
openssl: '1.0.1k' }


[ChildProcess.disconnect()]: child_process.html#child_process_child_disconnect
[ChildProcess.send()]: child_process.html#child_process_child_send_message_sendhandle_callback
[Signal Events]: #process_signal_events
[EventEmitter]: events.html#events_class_events_eventemitter
[net.Server]: net.html#net_class_net_server
[net.Socket]: net.html#net_class_net_socket
[`require.main`]: modules.html#modules_accessing_the_main_module
['message']: child_process.html#child_process_event_message
[Stream compatibility]: stream.html#stream_compatibility_with_older_node_js_versions
[the tty docs]: tty.html#tty_tty
12 changes: 7 additions & 5 deletions doc/api/punycode.markdown
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@

Stability: 2 - Stable

[Punycode.js](https://mths.be/punycode) is bundled with Node.js v0.6.2+. Use
`require('punycode')` to access it. (To use it with other Node.js versions, use
npm to install the `punycode` module first.)
[Punycode.js][] is bundled with Node.js v0.6.2+. Use `require('punycode')` to
access it. (To use it with other Node.js versions, use npm to install the
`punycode` module first.)

## punycode.decode(string)

@@ -47,8 +47,7 @@ you call it on a string that has already been converted to Unicode.
### punycode.ucs2.decode(string)

Creates an array containing the numeric code point values of each Unicode
symbol in the string. While [JavaScript uses UCS-2
internally](http://mathiasbynens.be/notes/javascript-encoding), this function
symbol in the string. While [JavaScript uses UCS-2 internally][], this function
will convert a pair of surrogate halves (each of which UCS-2 exposes as
separate characters) into a single code point, matching UTF-16.

@@ -66,3 +65,6 @@ Creates a string based on an array of numeric code point values.
## punycode.version

A string representing the current Punycode.js version number.

[Punycode.js]: https://mths.be/punycode
[JavaScript uses UCS-2 internally]: http://mathiasbynens.be/notes/javascript-encoding
25 changes: 16 additions & 9 deletions doc/api/stream.markdown
Original file line number Diff line number Diff line change
@@ -3,8 +3,7 @@
Stability: 2 - Stable

A stream is an abstract interface implemented by various objects in
Node.js. For example a [request to an HTTP
server](http.html#http_http_incomingmessage) is a stream, as is
Node.js. For example a [request to an HTTP server][] is a stream, as is
[stdout][]. Streams are readable, writable, or both. All streams are
instances of [EventEmitter][]

@@ -147,9 +146,9 @@ destinations drain and ask for more data.

Examples of readable streams include:

* [http responses, on the client](http.html#http_http_incomingmessage)
* [http requests, on the server](http.html#http_http_incomingmessage)
* [fs read streams](fs.html#fs_class_fs_readstream)
* [http responses, on the client][]
* [http requests, on the server][]
* [fs read streams][]
* [zlib streams][]
* [crypto streams][]
* [tcp sockets][]
@@ -559,13 +558,13 @@ that you are writing data *to*.

Examples of writable streams include:

* [http requests, on the client](http.html#http_class_http_clientrequest)
* [http responses, on the server](http.html#http_class_http_serverresponse)
* [fs write streams](fs.html#fs_class_fs_writestream)
* [http requests, on the client][]
* [http responses, on the server][]
* [fs write streams][]
* [zlib streams][]
* [crypto streams][]
* [tcp sockets][]
* [child process stdin](child_process.html#child_process_child_stdin)
* [child process stdin][]
* [process.stdout][], [process.stderr][]

#### Event: 'drain'
@@ -1677,6 +1676,7 @@ find that you have to use `stream.push('')`, please consider another
approach, because it almost certainly indicates that something is
horribly wrong.

[request to an HTTP server]: http.html#http_http_incomingmessage
[EventEmitter]: events.html#events_class_events_eventemitter
[Object mode]: #stream_object_mode
[`stream.push(chunk)`]: #stream_readable_push_chunk_encoding
@@ -1685,6 +1685,12 @@ horribly wrong.
[`unpipe()`]: #stream_readable_unpipe_destination
[unpiped]: #stream_readable_unpipe_destination
[tcp sockets]: net.html#net_class_net_socket
[http responses, on the client]: http.html#http_http_incomingmessage
[http requests, on the server]: http.html#http_http_incomingmessage
[http requests, on the client]: http.html#http_class_http_clientrequest
[http responses, on the server]: http.html#http_class_http_serverresponse
[fs read streams]: fs.html#fs_class_fs_readstream
[fs write streams]: fs.html#fs_class_fs_writestream
[zlib streams]: zlib.html
[zlib]: zlib.html
[crypto streams]: crypto.html
@@ -1695,6 +1701,7 @@ horribly wrong.
[process.stdout]: process.html#process_process_stdout
[process.stderr]: process.html#process_process_stderr
[child process stdout and stderr]: child_process.html#child_process_child_stdout
[child process stdin]: child_process.html#child_process_child_stdin
[API for Stream Consumers]: #stream_api_for_stream_consumers
[API for Stream Implementors]: #stream_api_for_stream_implementors
[Readable]: #stream_class_stream_readable
4 changes: 3 additions & 1 deletion doc/api/synopsis.markdown
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

<!--type=misc-->

An example of a [web server](http.html) written with Node.js which responds with
An example of a [web server][] written with Node.js which responds with
'Hello World':

var http = require('http');
@@ -21,3 +21,5 @@ it with the node program
Server running at http://127.0.0.1:8124/

All of the examples in the documentation can be run similarly.

[web server]: http.html
6 changes: 3 additions & 3 deletions doc/api/tls.markdown
Original file line number Diff line number Diff line change
@@ -339,9 +339,8 @@ of written data and all required TLS negotiation.
This instance implements a duplex [Stream][] interfaces. It has all the
common stream methods and events.

Methods that return TLS connection meta data (e.g.
[getPeerCertificate](#tlssocketgetpeercertificate-detailed-))
will only return data while the connection is open.
Methods that return TLS connection meta data (e.g. [getPeerCertificate][] will
only return data while the connection is open.

## new tls.TLSSocket(socket[, options])

@@ -900,3 +899,4 @@ Example:
[OCSP request]: http://en.wikipedia.org/wiki/OCSP_stapling
[TLS recommendations]: https://wiki.mozilla.org/Security/Server_Side_TLS
[TLS Session Tickets]: https://www.ietf.org/rfc/rfc5077.txt
[getPeerCertificate]: #tls_tlssocket_getpeercertificate_detailed
4 changes: 2 additions & 2 deletions doc/api/tty.markdown
Original file line number Diff line number Diff line change
@@ -32,8 +32,6 @@ of the `tty.ReadStream` instance.
`tty.ReadStream` to act either as a raw device or default. `isRaw` will be set
to the resulting mode.

[tty.ReadStream#setRawMode]: #tty_rs_setrawmode_mode

## Class: WriteStream

A `net.Socket` subclass that represents the writable portion of a tty. In normal
@@ -70,3 +68,5 @@ terminal.
## tty.setRawMode(mode)

Stability: 0 - Deprecated: Use [tty.ReadStream#setRawMode][] (i.e. process.stdin.setRawMode) instead.

[tty.ReadStream#setRawMode]: #tty_rs_setrawmode_mode
9 changes: 5 additions & 4 deletions doc/api/util.markdown
Original file line number Diff line number Diff line change
@@ -116,10 +116,9 @@ Each argument is converted to a string with `util.inspect()`.

## util.inherits(constructor, superConstructor)

Inherit the prototype methods from one
[constructor](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/constructor)
into another. The prototype of `constructor` will be set to a new
object created from `superConstructor`.
Inherit the prototype methods from one [constructor][] into another. The
prototype of `constructor` will be set to a new object created from
`superConstructor`.

As an additional convenience, `superConstructor` will be accessible
through the `constructor.super_` property.
@@ -505,3 +504,5 @@ Deprecated predecessor of `stream.pipe()`.
Stability: 0 - Deprecated: Use console.log() instead.

Deprecated predecessor of `console.log`.

[constructor]: https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/constructor
4 changes: 2 additions & 2 deletions doc/api/v8.markdown
Original file line number Diff line number Diff line change
@@ -29,8 +29,7 @@ crashes and data loss. Or it may simply do nothing.

The V8 options available for a version of node.js may be determined by running
`node --v8-options`. An unofficial, community-maintained list of options
and their effects is available
[here](https://github.com/thlorenz/v8-flags/blob/master/flags-0.11.md).
and their effects is available [here][].

Usage:

@@ -42,3 +41,4 @@ setTimeout(function() { v8.setFlagsFromString('--notrace_gc'); }, 60e3);
```

[V8]: https://code.google.com/p/v8/
[here]: https://github.com/thlorenz/v8-flags/blob/master/flags-0.11.md
9 changes: 4 additions & 5 deletions doc/api/vm.markdown
Original file line number Diff line number Diff line change
@@ -137,7 +137,7 @@ If given a `sandbox` object, will "contextify" that sandbox so that it can be
used in calls to `vm.runInContext` or `script.runInContext`. Inside scripts run
as such, `sandbox` will be the global object, retaining all its existing
properties but also having the built-in objects and functions any standard
[global object][2] has. Outside of scripts run by the vm module, `sandbox` will
[global object][] has. Outside of scripts run by the vm module, `sandbox` will
be unchanged.

If not given a sandbox object, returns a new, empty contextified sandbox object
@@ -148,8 +148,6 @@ scripts, e.g. if you were emulating a web browser it could be used to create a
single sandbox representing a window's global object, then run all `<script>`
tags together inside that sandbox.

[2]: http://es5.github.io/#x15.1

## vm.isContext(sandbox)

Returns whether or not a sandbox object has been contextified by calling
@@ -249,7 +247,7 @@ Example of using `vm.runInThisContext` and `eval` to run the same code:
`vm.runInThisContext` does not have access to the local scope, so `localVar` is
unchanged. `eval` does have access to the local scope, so `localVar` is changed.

In this way `vm.runInThisContext` is much like an [indirect `eval` call][1],
In this way `vm.runInThisContext` is much like an [indirect `eval` call][],
e.g. `(0,eval)('code')`. However, it also has the following additional options:

- `filename`: allows you to control the filename that shows up in any stack
@@ -261,4 +259,5 @@ e.g. `(0,eval)('code')`. However, it also has the following additional options:
- `timeout`: a number of milliseconds to execute `code` before terminating
execution. If execution is terminated, an `Error` will be thrown.

[1]: http://es5.github.io/#x10.4.2
[indirect `eval` call]: http://es5.github.io/#x10.4.2
[global object]: http://es5.github.io/#x15.1
52 changes: 27 additions & 25 deletions doc/api/zlib.markdown
Original file line number Diff line number Diff line change
@@ -39,17 +39,13 @@ the convenience methods.
}
});

To use this module in an HTTP client or server, use the
[accept-encoding](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3)
on requests, and the
[content-encoding](http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11)
header on responses.
To use this module in an HTTP client or server, use the [accept-encoding][]
on requests, and the [content-encoding][] header on responses.

**Note: these examples are drastically simplified to show
the basic concept.** Zlib encoding can be expensive, and the results
ought to be cached. See [Memory Usage Tuning](#zlib_memory_usage_tuning)
below for more information on the speed/memory/compression
tradeoffs involved in zlib usage.
ought to be cached. See [Memory Usage Tuning][] below for more information
on the speed/memory/compression tradeoffs involved in zlib usage.

// client request example
var zlib = require('zlib');
@@ -151,9 +147,9 @@ All of the constants defined in zlib.h are also defined on
`require('zlib')`.
In the normal course of operations, you will not need to ever set any of
these. They are documented here so that their presence is not
surprising. This section is taken almost directly from the [zlib
documentation](http://zlib.net/manual.html#Constants). See
<http://zlib.net/manual.html#Constants> for more details.
surprising. This section is taken almost directly from the
[zlib documentation][]. See <http://zlib.net/manual.html#Constants> for more
details.

Allowed flush values.

@@ -282,38 +278,31 @@ the inflate and deflate algorithms.

## zlib.createDeflate([options])

Returns a new [Deflate](#zlib_class_zlib_deflate) object with an
[options](#zlib_options).
Returns a new [Deflate][] object with an [options][].

## zlib.createDeflateRaw([options])

Returns a new [DeflateRaw](#zlib_class_zlib_deflateraw) object with an
[options](#zlib_options).
Returns a new [DeflateRaw][] object with an [options][].

## zlib.createGunzip([options])

Returns a new [Gunzip](#zlib_class_zlib_gunzip) object with an
[options](#zlib_options).
Returns a new [Gunzip][] object with an [options][].

## zlib.createGzip([options])

Returns a new [Gzip](#zlib_class_zlib_gzip) object with an
[options](#zlib_options).
Returns a new [Gzip][] object with an [options][].

## zlib.createInflate([options])

Returns a new [Inflate](#zlib_class_zlib_inflate) object with an
[options](#zlib_options).
Returns a new [Inflate][] object with an [options][].

## zlib.createInflateRaw([options])

Returns a new [InflateRaw](#zlib_class_zlib_inflateraw) object with an
[options](#zlib_options).
Returns a new [InflateRaw][] object with an [options][].

## zlib.createUnzip([options])

Returns a new [Unzip](#zlib_class_zlib_unzip) object with an
[options](#zlib_options).
Returns a new [Unzip][] object with an [options][].

## Convenience Methods

@@ -366,3 +355,16 @@ Decompress a raw Buffer with Inflate.
### zlib.unzipSync(buf[, options])

Decompress a raw Buffer with Unzip.

[accept-encoding]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.3
[content-encoding]: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11
[Memory Usage Tuning]: #zlib_memory_usage_tuning
[zlib documentation]: http://zlib.net/manual.html#Constants
[options]: #zlib_options
[Deflate]: #zlib_class_zlib_deflate
[DeflateRaw]: #zlib_class_zlib_deflateraw
[Gunzip]: #zlib_class_zlib_gunzip
[Gzip]: #zlib_class_zlib_gzip
[Inflate]: #zlib_class_zlib_inflate
[InflateRaw]: #zlib_class_zlib_inflateraw
[Unzip]: #zlib_class_zlib_unzip