Browse Source

doc: update node.js references in api docs

Fixes: https://github.com/iojs/io.js/issues/740
PR-URL: https://github.com/iojs/io.js/pull/750
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
v1.8.0-commit
Ben Noordhuis 10 years ago
committed by cjihrig
parent
commit
789bbb91d3
  1. 12
      doc/api/addons.markdown
  2. 8
      doc/api/buffer.markdown
  3. 27
      doc/api/child_process.markdown
  4. 16
      doc/api/cluster.markdown
  5. 6
      doc/api/crypto.markdown
  6. 20
      doc/api/debugger.markdown
  7. 2
      doc/api/dgram.markdown
  8. 4
      doc/api/dns.markdown
  9. 4
      doc/api/documentation.markdown
  10. 2
      doc/api/domain.markdown
  11. 8
      doc/api/events.markdown
  12. 6
      doc/api/fs.markdown
  13. 12
      doc/api/globals.markdown
  14. 28
      doc/api/http.markdown
  15. 2
      doc/api/https.markdown
  16. 38
      doc/api/modules.markdown
  17. 6
      doc/api/net.markdown
  18. 8
      doc/api/path.markdown
  19. 98
      doc/api/process.markdown
  20. 2
      doc/api/punycode.markdown
  21. 8
      doc/api/readline.markdown
  22. 22
      doc/api/repl.markdown
  23. 34
      doc/api/stream.markdown
  24. 8
      doc/api/synopsis.markdown
  25. 2
      doc/api/timers.markdown
  26. 8
      doc/api/tls.markdown
  27. 12
      doc/api/tty.markdown
  28. 4
      doc/api/util.markdown
  29. 4
      doc/api/v8.markdown
  30. 4
      doc/api/zlib.markdown

12
doc/api/addons.markdown

@ -6,7 +6,7 @@ knowledge of several libraries:
- V8 JavaScript, a C++ library. Used for interfacing with JavaScript: - V8 JavaScript, a C++ library. Used for interfacing with JavaScript:
creating objects, calling functions, etc. Documented mostly in the creating objects, calling functions, etc. Documented mostly in the
`v8.h` header file (`deps/v8/include/v8.h` in the Node source `v8.h` header file (`deps/v8/include/v8.h` in the io.js source
tree), which is also available tree), which is also available
[online](http://izs.me/v8-docs/main.html). [online](http://izs.me/v8-docs/main.html).
@ -16,12 +16,12 @@ knowledge of several libraries:
to interface with libuv. That is, if you perform any I/O, libuv will to interface with libuv. That is, if you perform any I/O, libuv will
need to be used. need to be used.
- Internal Node libraries. Most importantly is the `node::ObjectWrap` - Internal io.js libraries. Most importantly is the `node::ObjectWrap`
class which you will likely want to derive from. class which you will likely want to derive from.
- Others. Look in `deps/` for what else is available. - Others. Look in `deps/` for what else is available.
Node statically compiles all its dependencies into the executable. io.js statically compiles all its dependencies into the executable.
When compiling your module, you don't need to worry about linking to When compiling your module, you don't need to worry about linking to
any of these libraries. any of these libraries.
@ -55,7 +55,7 @@ First we create a file `hello.cc`:
NODE_MODULE(addon, init) NODE_MODULE(addon, init)
Note that all Node addons must export an initialization function: Note that all io.js addons must export an initialization function:
void Initialize (Handle<Object> exports); void Initialize (Handle<Object> exports);
NODE_MODULE(module_name, Initialize) NODE_MODULE(module_name, Initialize)
@ -90,7 +90,7 @@ command.
Now you have your compiled `.node` bindings file! The compiled bindings end up Now you have your compiled `.node` bindings file! The compiled bindings end up
in `build/Release/`. in `build/Release/`.
You can now use the binary addon in a Node project `hello.js` by pointing You can now use the binary addon in an io.js project `hello.js` by pointing
`require` to the recently built `hello.node` module: `require` to the recently built `hello.node` module:
// hello.js // hello.js
@ -564,7 +564,7 @@ Test it with:
### Passing wrapped objects around ### Passing wrapped objects around
In addition to wrapping and returning C++ objects, you can pass them around In addition to wrapping and returning C++ objects, you can pass them around
by unwrapping them with Node's `node::ObjectWrap::Unwrap` helper function. by unwrapping them with io.js's `node::ObjectWrap::Unwrap` helper function.
In the following `addon.cc` we introduce a function `add()` that can take on two In the following `addon.cc` we introduce a function `add()` that can take on two
`MyObject` objects: `MyObject` objects:

8
doc/api/buffer.markdown

@ -4,7 +4,7 @@
Pure JavaScript is Unicode friendly but not nice to binary data. When Pure JavaScript is Unicode friendly but not nice to binary data. When
dealing with TCP streams or the file system, it's necessary to handle octet dealing with TCP streams or the file system, it's necessary to handle octet
streams. Node has several strategies for manipulating, creating, and streams. io.js has several strategies for manipulating, creating, and
consuming octet streams. consuming octet streams.
Raw data is stored in instances of the `Buffer` class. A `Buffer` is similar Raw data is stored in instances of the `Buffer` class. A `Buffer` is similar
@ -33,7 +33,7 @@ encoding method. Here are the different string encodings.
* `'binary'` - A way of encoding raw binary data into strings by using only * `'binary'` - A way of encoding raw binary data into strings by using only
the first 8 bits of each character. This encoding method is deprecated and the first 8 bits of each character. This encoding method is deprecated and
should be avoided in favor of `Buffer` objects where possible. This encoding should be avoided in favor of `Buffer` objects where possible. This encoding
will be removed in future versions of Node. will be removed in future versions of io.js.
* `'hex'` - Encode each byte as two hexadecimal characters. * `'hex'` - Encode each byte as two hexadecimal characters.
@ -295,7 +295,7 @@ so the legal range is between `0x00` and `0xFF` hex or `0` and `255`.
Example: copy an ASCII string into a buffer, one byte at a time: Example: copy an ASCII string into a buffer, one byte at a time:
str = "node.js"; str = "io.js";
buf = new Buffer(str.length); buf = new Buffer(str.length);
for (var i = 0; i < str.length ; i++) { for (var i = 0; i < str.length ; i++) {
@ -304,7 +304,7 @@ Example: copy an ASCII string into a buffer, one byte at a time:
console.log(buf); console.log(buf);
// node.js // io.js
### buf.equals(otherBuffer) ### buf.equals(otherBuffer)

27
doc/api/child_process.markdown

@ -2,12 +2,12 @@
Stability: 3 - Stable Stability: 3 - Stable
Node provides a tri-directional `popen(3)` facility through the io.js provides a tri-directional `popen(3)` facility through the
`child_process` module. `child_process` module.
It is possible to stream data through a child's `stdin`, `stdout`, and It is possible to stream data through a child's `stdin`, `stdout`, and
`stderr` in a fully non-blocking way. (Note that some programs use `stderr` in a fully non-blocking way. (Note that some programs use
line-buffered I/O internally. That doesn't affect node.js but it means line-buffered I/O internally. That doesn't affect io.js but it means
data you send to the child process may not be immediately consumed.) data you send to the child process may not be immediately consumed.)
To create a child process use `require('child_process').spawn()` or To create a child process use `require('child_process').spawn()` or
@ -61,8 +61,9 @@ of the signal, otherwise `null`.
Note that the child process stdio streams might still be open. Note that the child process stdio streams might still be open.
Also, note that node establishes signal handlers for `'SIGINT'` and `'SIGTERM`', Also, note that io.js establishes signal handlers for `'SIGINT'` and
so it will not terminate due to receipt of those signals, it will exit. `'SIGTERM`', so it will not terminate due to receipt of those signals,
it will exit.
See `waitpid(2)`. See `waitpid(2)`.
@ -248,7 +249,7 @@ instead, see
There is a special case when sending a `{cmd: 'NODE_foo'}` message. All messages There is a special case when sending a `{cmd: 'NODE_foo'}` message. All messages
containing a `NODE_` prefix in its `cmd` property will not be emitted in containing a `NODE_` prefix in its `cmd` property will not be emitted in
the `message` event, since they are internal messages used by node core. the `message` event, since they are internal messages used by io.js core.
Messages containing the prefix are emitted in the `internalMessage` event, you Messages containing the prefix are emitted in the `internalMessage` event, you
should by all means avoid using this feature, it is subject to change without notice. should by all means avoid using this feature, it is subject to change without notice.
@ -458,12 +459,12 @@ index corresponds to a fd in the child. The value is one of the following:
between parent and child. A ChildProcess may have at most *one* IPC stdio between parent and child. A ChildProcess may have at most *one* IPC stdio
file descriptor. Setting this option enables the ChildProcess.send() method. file descriptor. Setting this option enables the ChildProcess.send() method.
If the child writes JSON messages to this file descriptor, then this will If the child writes JSON messages to this file descriptor, then this will
trigger ChildProcess.on('message'). If the child is a Node.js program, then trigger ChildProcess.on('message'). If the child is an io.js program, then
the presence of an IPC channel will enable process.send() and the presence of an IPC channel will enable process.send() and
process.on('message'). process.on('message').
3. `'ignore'` - Do not set this file descriptor in the child. Note that Node 3. `'ignore'` - Do not set this file descriptor in the child. Note that io.js
will always open fd 0 - 2 for the processes it spawns. When any of these is will always open fd 0 - 2 for the processes it spawns. When any of these is
ignored node will open `/dev/null` and attach it to the child's fd. ignored io.js will open `/dev/null` and attach it to the child's fd.
4. `Stream` object - Share a readable or writable stream that refers to a tty, 4. `Stream` object - Share a readable or writable stream that refers to a tty,
file, socket, or a pipe with the child process. The stream's underlying file, socket, or a pipe with the child process. The stream's underlying
file descriptor is duplicated in the child process to the fd that file descriptor is duplicated in the child process to the fd that
@ -625,17 +626,17 @@ leaner than `child_process.exec`. It has the same options.
* `gid` {Number} Sets the group identity of the process. (See setgid(2).) * `gid` {Number} Sets the group identity of the process. (See setgid(2).)
* Return: ChildProcess object * Return: ChildProcess object
This is a special case of the `spawn()` functionality for spawning Node This is a special case of the `spawn()` functionality for spawning io.js
processes. In addition to having all the methods in a normal ChildProcess processes. In addition to having all the methods in a normal ChildProcess
instance, the returned object has a communication channel built-in. See instance, the returned object has a communication channel built-in. See
`child.send(message, [sendHandle])` for details. `child.send(message, [sendHandle])` for details.
These child Nodes are still whole new instances of V8. Assume at least 30ms These child io.js processes are still whole new instances of V8. Assume at
startup and 10mb memory for each new Node. That is, you cannot create many least 30ms startup and 10mb memory for each new io.js. That is, you cannot
thousands of them. create many thousands of them.
The `execPath` property in the `options` object allows for a process to be The `execPath` property in the `options` object allows for a process to be
created for the child rather than the current `node` executable. This should be created for the child rather than the current `iojs` executable. This should be
done with care and by default will talk over the fd represented an done with care and by default will talk over the fd represented an
environmental variable `NODE_CHANNEL_FD` on the child process. The input and environmental variable `NODE_CHANNEL_FD` on the child process. The input and
output on this fd is expected to be line delimited JSON objects. output on this fd is expected to be line delimited JSON objects.

16
doc/api/cluster.markdown

@ -2,8 +2,8 @@
Stability: 2 - Unstable Stability: 2 - Unstable
A single instance of Node runs in a single thread. To take advantage of A single instance of io.js runs in a single thread. To take advantage of
multi-core systems the user will sometimes want to launch a cluster of Node multi-core systems the user will sometimes want to launch a cluster of io.js
processes to handle the load. processes to handle the load.
The cluster module allows you to easily create child processes that The cluster module allows you to easily create child processes that
@ -31,9 +31,9 @@ all share server ports.
}).listen(8000); }).listen(8000);
} }
Running node will now share port 8000 between the workers: Running io.js will now share port 8000 between the workers:
% NODE_DEBUG=cluster node server.js % NODE_DEBUG=cluster iojs server.js
23521,Master Worker 23524 online 23521,Master Worker 23524 online
23521,Master Worker 23526 online 23521,Master Worker 23526 online
23521,Master Worker 23523 online 23521,Master Worker 23523 online
@ -74,7 +74,7 @@ out of a total of eight.
Because `server.listen()` hands off most of the work to the master Because `server.listen()` hands off most of the work to the master
process, there are three cases where the behavior between a normal process, there are three cases where the behavior between a normal
node.js process and a cluster worker differs: io.js process and a cluster worker differs:
1. `server.listen({fd: 7})` Because the message is passed to the master, 1. `server.listen({fd: 7})` Because the message is passed to the master,
file descriptor 7 **in the parent** will be listened on, and the file descriptor 7 **in the parent** will be listened on, and the
@ -91,7 +91,7 @@ node.js process and a cluster worker differs:
want to listen on a unique port, generate a port number based on the want to listen on a unique port, generate a port number based on the
cluster worker ID. cluster worker ID.
There is no routing logic in Node.js, or in your program, and no shared There is no routing logic in io.js, or in your program, and no shared
state between the workers. Therefore, it is important to design your state between the workers. Therefore, it is important to design your
program such that it does not rely too heavily on in-memory data objects program such that it does not rely too heavily on in-memory data objects
for things like sessions and login. for things like sessions and login.
@ -99,7 +99,7 @@ for things like sessions and login.
Because workers are all separate processes, they can be killed or Because workers are all separate processes, they can be killed or
re-spawned depending on your program's needs, without affecting other re-spawned depending on your program's needs, without affecting other
workers. As long as there are some workers still alive, the server will workers. As long as there are some workers still alive, the server will
continue to accept connections. Node does not automatically manage the continue to accept connections. io.js does not automatically manage the
number of workers for you, however. It is your responsibility to manage number of workers for you, however. It is your responsibility to manage
the worker pool for your application's needs. the worker pool for your application's needs.
@ -121,7 +121,7 @@ values are `"rr"` and `"none"`.
## cluster.settings ## cluster.settings
* {Object} * {Object}
* `execArgv` {Array} list of string arguments passed to the node executable. * `execArgv` {Array} list of string arguments passed to the io.js executable.
(Default=`process.execArgv`) (Default=`process.execArgv`)
* `exec` {String} file path to worker file. (Default=`process.argv[1]`) * `exec` {String} file path to worker file. (Default=`process.argv[1]`)
* `args` {Array} string arguments passed to worker. * `args` {Array} string arguments passed to worker.

6
doc/api/crypto.markdown

@ -77,7 +77,7 @@ dictionary with keys:
<http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT> <http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT>
for details on the format. for details on the format.
If no 'ca' details are given, then node.js will use the default If no 'ca' details are given, then io.js will use the default
publicly trusted list of CAs as given in publicly trusted list of CAs as given in
<http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt>. <http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt>.
@ -733,12 +733,12 @@ as a temporary measure.
## Recent API Changes ## Recent API Changes
The Crypto module was added to Node before there was the concept of a The Crypto module was added to Node.js before there was the concept of a
unified Stream API, and before there were Buffer objects for handling unified Stream API, and before there were Buffer objects for handling
binary data. binary data.
As such, the streaming classes don't have the typical methods found on As such, the streaming classes don't have the typical methods found on
other Node classes, and many methods accepted and returned other io.js classes, and many methods accepted and returned
Binary-encoded strings by default rather than Buffers. This was Binary-encoded strings by default rather than Buffers. This was
changed to use Buffers by default instead. changed to use Buffers by default instead.

20
doc/api/debugger.markdown

@ -6,10 +6,10 @@
V8 comes with an extensive debugger which is accessible out-of-process via a 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). simple [TCP protocol](http://code.google.com/p/v8/wiki/DebuggerProtocol).
Node has a built-in client for this debugger. To use this, start Node with the io.js has a built-in client for this debugger. To use this, start io.js with the
`debug` argument; a prompt will appear: `debug` argument; a prompt will appear:
% node debug myscript.js % iojs debug myscript.js
< debugger listening on port 5858 < debugger listening on port 5858
connecting... ok connecting... ok
break in /home/indutny/Code/git/indutny/myscript.js:1 break in /home/indutny/Code/git/indutny/myscript.js:1
@ -18,7 +18,7 @@ Node has a built-in client for this debugger. To use this, start Node with the
3 debugger; 3 debugger;
debug> debug>
Node's debugger client doesn't support the full range of commands, but io.js's debugger client doesn't support the full range of commands, but
simple step and inspection is possible. By putting the statement `debugger;` simple step and inspection is possible. By putting the statement `debugger;`
into the source code of your script, you will enable a breakpoint. into the source code of your script, you will enable a breakpoint.
@ -34,7 +34,7 @@ For example, suppose `myscript.js` looked like this:
Then once the debugger is run, it will break on line 4. Then once the debugger is run, it will break on line 4.
% node debug myscript.js % iojs debug myscript.js
< debugger listening on port 5858 < debugger listening on port 5858
connecting... ok connecting... ok
break in /home/indutny/Code/git/indutny/myscript.js:1 break in /home/indutny/Code/git/indutny/myscript.js:1
@ -113,7 +113,7 @@ on line 1
It is also possible to set a breakpoint in a file (module) that It is also possible to set a breakpoint in a file (module) that
isn't loaded yet: isn't loaded yet:
% ./node debug test/fixtures/break-in-module/main.js % ./iojs debug test/fixtures/break-in-module/main.js
< debugger listening on port 5858 < debugger listening on port 5858
connecting to port 5858... ok connecting to port 5858... ok
break in test/fixtures/break-in-module/main.js:1 break in test/fixtures/break-in-module/main.js:1
@ -158,13 +158,13 @@ breakpoint)
## Advanced Usage ## Advanced Usage
The V8 debugger can be enabled and accessed either by starting Node with The V8 debugger can be enabled and accessed either by starting io.js with
the `--debug` command-line flag or by signaling an existing Node process the `--debug` command-line flag or by signaling an existing io.js process
with `SIGUSR1`. with `SIGUSR1`.
Once a process has been set in debug mode with this it can be connected to Once a process has been set in debug mode with this it can be connected to
with the node debugger. Either connect to the `pid` or the URI to the debugger. with the io.js debugger. Either connect to the `pid` or the URI to the debugger.
The syntax is: The syntax is:
* `node debug -p <pid>` - Connects to the process via the `pid` * `iojs debug -p <pid>` - Connects to the process via the `pid`
* `node debug <URI>` - Connects to the process via the URI such as localhost:5858 * `iojs debug <URI>` - Connects to the process via the URI such as localhost:5858

2
doc/api/dgram.markdown

@ -170,7 +170,7 @@ and the `callback`(if specified) is called. Specifying both a
"listening" event listener and `callback` is not harmful but not very "listening" event listener and `callback` is not harmful but not very
useful. useful.
A bound datagram socket keeps the node process running to receive A bound datagram socket keeps the io.js process running to receive
datagrams. datagrams.
If binding fails, an "error" event is generated. In rare case (e.g. If binding fails, an "error" event is generated. In rare case (e.g.

4
doc/api/dns.markdown

@ -103,7 +103,7 @@ It's only an operating system facility that can associate name with addresses,
and vice versa. and vice versa.
Its implementation can have subtle but important consequences on the behavior Its implementation can have subtle but important consequences on the behavior
of any Node.js program. Please take some time to consult the [Implementation of any io.js program. Please take some time to consult the [Implementation
considerations section](#dns_implementation_considerations) before using it. considerations section](#dns_implementation_considerations) before using it.
## dns.lookupService(address, port, callback) ## dns.lookupService(address, port, callback)
@ -275,7 +275,7 @@ were found, then return IPv4 mapped IPv6 addresses.
Although `dns.lookup` and `dns.resolve*/dns.reverse` functions have the same Although `dns.lookup` and `dns.resolve*/dns.reverse` functions have the same
goal of associating a network name with a network address (or vice versa), goal of associating a network name with a network address (or vice versa),
their behavior is quite different. These differences can have subtle but their behavior is quite different. These differences can have subtle but
significant consequences on the behavior of Node.js programs. significant consequences on the behavior of io.js programs.
### dns.lookup ### dns.lookup

4
doc/api/documentation.markdown

@ -2,7 +2,7 @@
<!-- type=misc --> <!-- type=misc -->
The goal of this documentation is to comprehensively explain the Node.js The goal of this documentation is to comprehensively explain the io.js
API, both from a reference as well as a conceptual point of view. Each API, both from a reference as well as a conceptual point of view. Each
section describes a built-in module or high-level concept. section describes a built-in module or high-level concept.
@ -25,7 +25,7 @@ The HTML template is located at `doc/template.html`.
<!--type=misc--> <!--type=misc-->
Throughout the documentation, you will see indications of a section's Throughout the documentation, you will see indications of a section's
stability. The Node.js API is still somewhat changing, and as it stability. The io.js API is still somewhat changing, and as it
matures, certain parts are more reliable than others. Some are so matures, certain parts are more reliable than others. Some are so
proven, and so relied upon, that they are unlikely to ever change at proven, and so relied upon, that they are unlikely to ever change at
all. Others are brand new and experimental, or known to be hazardous all. Others are brand new and experimental, or known to be hazardous

2
doc/api/domain.markdown

@ -38,7 +38,7 @@ time, and stop listening for new requests in that worker.
In this way, `domain` usage goes hand-in-hand with the cluster module, In this way, `domain` usage goes hand-in-hand with the cluster module,
since the master process can fork a new worker when a worker since the master process can fork a new worker when a worker
encounters an error. For node programs that scale to multiple encounters an error. For io.js programs that scale to multiple
machines, the terminating proxy or service registry can take note of machines, the terminating proxy or service registry can take note of
the failure, and react accordingly. the failure, and react accordingly.

8
doc/api/events.markdown

@ -4,7 +4,7 @@
<!--type=module--> <!--type=module-->
Many objects in Node emit events: a `net.Server` emits an event each time Many objects in io.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 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`. opened. All objects which emit events are instances of `events.EventEmitter`.
You can access this module by doing: `require("events");` You can access this module by doing: `require("events");`
@ -23,9 +23,9 @@ attached to.
To access the EventEmitter class, `require('events').EventEmitter`. To access the EventEmitter class, `require('events').EventEmitter`.
When an `EventEmitter` instance experiences an error, the typical action is When an `EventEmitter` instance experiences an error, the typical action is
to emit an `'error'` event. Error events are treated as a special case in node. to emit an `'error'` event. Error events are treated as a special case in
If there is no listener for it, then the default action is to print a stack io.js. If there is no listener for it, then the default action is to print
trace and exit the program. a stack trace and exit the program.
All EventEmitters emit the event `'newListener'` when new listeners are All EventEmitters emit the event `'newListener'` when new listeners are
added and `'removeListener'` when a listener is removed. added and `'removeListener'` when a listener is removed.

6
doc/api/fs.markdown

@ -72,7 +72,7 @@ site, set the NODE_DEBUG environment variable:
} }
bad(); bad();
$ env NODE_DEBUG=fs node script.js $ env NODE_DEBUG=fs iojs script.js
fs.js:66 fs.js:66
throw err; throw err;
^ ^
@ -498,7 +498,7 @@ to `'utf8'`.
Example: Example:
fs.writeFile('message.txt', 'Hello Node', function (err) { fs.writeFile('message.txt', 'Hello io.js', function (err) {
if (err) throw err; if (err) throw err;
console.log('It\'s saved!'); console.log('It\'s saved!');
}); });
@ -757,7 +757,7 @@ The times in the stat object have the following semantics:
an earlier value than the current `birthtime` using the `utimes(2)` an earlier value than the current `birthtime` using the `utimes(2)`
system call. system call.
Prior to Node v0.12, the `ctime` held the `birthtime` on Windows Prior to io.js v1.0 and Node v0.12, the `ctime` held the `birthtime` on Windows
systems. Note that as of v0.12, `ctime` is not "creation time", and systems. Note that as of v0.12, `ctime` is not "creation time", and
on Unix systems, it never was. on Unix systems, it never was.

12
doc/api/globals.markdown

@ -13,8 +13,8 @@ actually in the global scope but in the module scope - this will be noted.
In browsers, the top-level scope is the global scope. That means that in In browsers, the top-level scope is the global scope. That means that in
browsers if you're in the global scope `var something` will define a global browsers if you're in the global scope `var something` will define a global
variable. In Node this is different. The top-level scope is not the global variable. In io.js this is different. The top-level scope is not the global
scope; `var something` inside a Node module will be local to that module. scope; `var something` inside an io.js module will be local to that module.
## process ## process
@ -74,9 +74,9 @@ Process files with the extension `.sjs` as `.js`:
require.extensions['.sjs'] = require.extensions['.js']; require.extensions['.sjs'] = require.extensions['.js'];
**Deprecated** In the past, this list has been used to load **Deprecated** In the past, this list has been used to load
non-JavaScript modules into Node by compiling them on-demand. non-JavaScript modules into io.js by compiling them on-demand.
However, in practice, there are much better ways to do this, such as However, in practice, there are much better ways to do this, such as
loading modules via some other Node program, or compiling them to loading modules via some other io.js program, or compiling them to
JavaScript ahead of time. JavaScript ahead of time.
Since the Module system is locked, this feature will probably never go Since the Module system is locked, this feature will probably never go
@ -94,7 +94,7 @@ of this code file. For a main program this is not necessarily the same
filename used in the command line. The value inside a module is the path filename used in the command line. The value inside a module is the path
to that module file. to that module file.
Example: running `node example.js` from `/Users/mjr` Example: running `iojs example.js` from `/Users/mjr`
console.log(__filename); console.log(__filename);
// /Users/mjr/example.js // /Users/mjr/example.js
@ -109,7 +109,7 @@ Example: running `node example.js` from `/Users/mjr`
The name of the directory that the currently executing script resides in. The name of the directory that the currently executing script resides in.
Example: running `node example.js` from `/Users/mjr` Example: running `iojs example.js` from `/Users/mjr`
console.log(__dirname); console.log(__dirname);
// /Users/mjr // /Users/mjr

28
doc/api/http.markdown

@ -4,7 +4,7 @@
To use the HTTP server and client one must `require('http')`. To use the HTTP server and client one must `require('http')`.
The HTTP interfaces in Node are designed to support many features The HTTP interfaces in io.js are designed to support many features
of the protocol which have been traditionally difficult to use. of the protocol which have been traditionally difficult to use.
In particular, large, possibly chunk-encoded, messages. The interface is In particular, large, possibly chunk-encoded, messages. The interface is
careful to never buffer entire requests or responses--the careful to never buffer entire requests or responses--the
@ -20,7 +20,7 @@ HTTP message headers are represented by an object like this:
Keys are lowercased. Values are not modified. Keys are lowercased. Values are not modified.
In order to support the full spectrum of possible HTTP applications, Node's In order to support the full spectrum of possible HTTP applications, io.js's
HTTP API is very low-level. It deals with stream handling and message HTTP API is very low-level. It deals with stream handling and message
parsing only. It parses a message into headers and body but it does not parsing only. It parses a message into headers and body but it does not
parse the actual headers or the body. parse the actual headers or the body.
@ -300,7 +300,7 @@ Note that Content-Length is given in bytes not characters. The above example
works because the string `'hello world'` contains only single byte characters. works because the string `'hello world'` contains only single byte characters.
If the body contains higher coded characters then `Buffer.byteLength()` If the body contains higher coded characters then `Buffer.byteLength()`
should be used to determine the number of bytes in a given encoding. should be used to determine the number of bytes in a given encoding.
And Node does not check whether Content-Length and the length of the body And io.js does not check whether Content-Length and the length of the body
which has been transmitted are equal or not. which has been transmitted are equal or not.
### response.setTimeout(msecs, callback) ### response.setTimeout(msecs, callback)
@ -408,7 +408,7 @@ higher-level multi-part body encodings that may be used.
The first time `response.write()` is called, it will send the buffered The first time `response.write()` is called, it will send the buffered
header information and the first body to the client. The second time header information and the first body to the client. The second time
`response.write()` is called, Node assumes you're going to be streaming `response.write()` is called, io.js assumes you're going to be streaming
data, and sends that separately. That is, the response is buffered up to the data, and sends that separately. That is, the response is buffered up to the
first chunk of body. first chunk of body.
@ -450,7 +450,7 @@ is finished.
## http.request(options[, callback]) ## http.request(options[, callback])
Node maintains several connections per server to make HTTP requests. io.js maintains several connections per server to make HTTP requests.
This function allows one to transparently issue requests. This function allows one to transparently issue requests.
`options` can be an object or a string. If `options` is a string, it is `options` can be an object or a string. If `options` is a string, it is
@ -538,7 +538,7 @@ on the returned request object.
There are a few special headers that should be noted. There are a few special headers that should be noted.
* Sending a 'Connection: keep-alive' will notify Node that the connection to * Sending a 'Connection: keep-alive' will notify io.js that the connection to
the server should be persisted until the next request. the server should be persisted until the next request.
* Sending a 'Content-length' header will disable the default chunked encoding. * Sending a 'Content-length' header will disable the default chunked encoding.
@ -553,7 +553,7 @@ There are a few special headers that should be noted.
## http.get(options[, callback]) ## http.get(options[, callback])
Since most requests are GET requests without bodies, Node provides this Since most requests are GET requests without bodies, io.js provides this
convenience method. The only difference between this method and `http.request()` convenience method. The only difference between this method and `http.request()`
is that it sets the method to GET and calls `req.end()` automatically. is that it sets the method to GET and calls `req.end()` automatically.
@ -573,7 +573,7 @@ requests.
The HTTP Agent also defaults client requests to using The HTTP Agent also defaults client requests to using
Connection:keep-alive. If no pending HTTP requests are waiting on a Connection:keep-alive. If no pending HTTP requests are waiting on a
socket to become free the socket is closed. This means that Node's socket to become free the socket is closed. This means that io.js's
pool has the benefit of keep-alive when under load but still does not pool has the benefit of keep-alive when under load but still does not
require developers to manually close the HTTP clients using require developers to manually close the HTTP clients using
KeepAlive. KeepAlive.
@ -582,7 +582,7 @@ If you opt into using HTTP KeepAlive, you can create an Agent object
with that flag set to `true`. (See the [constructor with that flag set to `true`. (See the [constructor
options](#http_new_agent_options) below.) Then, the Agent will keep options](#http_new_agent_options) below.) Then, the Agent will keep
unused sockets in a pool for later use. They will be explicitly unused sockets in a pool for later use. They will be explicitly
marked so as to not keep the Node process running. However, it is marked so as to not keep the io.js process running. However, it is
still a good idea to explicitly [`destroy()`](#http_agent_destroy) still a good idea to explicitly [`destroy()`](#http_agent_destroy)
KeepAlive agents when they are no longer in use, so that the Sockets KeepAlive agents when they are no longer in use, so that the Sockets
will be shut down. will be shut down.
@ -714,7 +714,7 @@ Until the data is consumed, the `'end'` event will not fire. Also, until
the data is read it will consume memory that can eventually lead to a the data is read it will consume memory that can eventually lead to a
'process out of memory' error. 'process out of memory' error.
Note: Node does not check whether Content-Length and the length of the body Note: io.js does not check whether Content-Length and the length of the body
which has been transmitted are equal or not. which has been transmitted are equal or not.
The request implements the [Writable Stream][] interface. This is an The request implements the [Writable Stream][] interface. This is an
@ -763,7 +763,7 @@ A client server pair that show you how to listen for the `connect` event.
var srvUrl = url.parse('http://' + req.url); var srvUrl = url.parse('http://' + req.url);
var srvSocket = net.connect(srvUrl.port, srvUrl.hostname, function() { var srvSocket = net.connect(srvUrl.port, srvUrl.hostname, function() {
cltSocket.write('HTTP/1.1 200 Connection Established\r\n' + cltSocket.write('HTTP/1.1 200 Connection Established\r\n' +
'Proxy-agent: Node-Proxy\r\n' + 'Proxy-agent: io.js-Proxy\r\n' +
'\r\n'); '\r\n');
srvSocket.write(head); srvSocket.write(head);
srvSocket.pipe(cltSocket); srvSocket.pipe(cltSocket);
@ -863,7 +863,7 @@ the client should send the request body.
Flush the request headers. Flush the request headers.
For efficiency reasons, node.js normally buffers the request headers until you For efficiency reasons, io.js normally buffers the request headers until you
call `request.end()` or write the first chunk of request data. It then tries call `request.end()` or write the first chunk of request data. It then tries
hard to pack the request headers and data into a single TCP packet. hard to pack the request headers and data into a single TCP packet.
@ -1022,7 +1022,7 @@ Then `request.url` will be:
If you would like to parse the URL into its parts, you can use If you would like to parse the URL into its parts, you can use
`require('url').parse(request.url)`. Example: `require('url').parse(request.url)`. Example:
node> require('url').parse('/status?name=ryan') iojs> require('url').parse('/status?name=ryan')
{ href: '/status?name=ryan', { href: '/status?name=ryan',
search: '?name=ryan', search: '?name=ryan',
query: 'name=ryan', query: 'name=ryan',
@ -1032,7 +1032,7 @@ If you would like to extract the params from the query string,
you can use the `require('querystring').parse` function, or pass you can use the `require('querystring').parse` function, or pass
`true` as the second argument to `require('url').parse`. Example: `true` as the second argument to `require('url').parse`. Example:
node> require('url').parse('/status?name=ryan', true) iojs> require('url').parse('/status?name=ryan', true)
{ href: '/status?name=ryan', { href: '/status?name=ryan',
search: '?name=ryan', search: '?name=ryan',
query: { name: 'ryan' }, query: { name: 'ryan' },

2
doc/api/https.markdown

@ -2,7 +2,7 @@
Stability: 3 - Stable Stability: 3 - Stable
HTTPS is the HTTP protocol over TLS/SSL. In Node this is implemented as a HTTPS is the HTTP protocol over TLS/SSL. In io.js this is implemented as a
separate module. separate module.
## Class: https.Server ## Class: https.Server

38
doc/api/modules.markdown

@ -4,7 +4,7 @@
<!--name=module--> <!--name=module-->
Node has a simple module loading system. In Node, files and modules are in io.js has a simple module loading system. In io.js, files and modules are in
one-to-one correspondence. As an example, `foo.js` loads the module one-to-one correspondence. As an example, `foo.js` loads the module
`circle.js` in the same directory. `circle.js` in the same directory.
@ -100,7 +100,7 @@ provided to the `a.js` module.
By the time `main.js` has loaded both modules, they're both finished. By the time `main.js` has loaded both modules, they're both finished.
The output of this program would thus be: The output of this program would thus be:
$ node main.js $ iojs main.js
main starting main starting
a starting a starting
b starting b starting
@ -117,10 +117,10 @@ plan accordingly.
<!--type=misc--> <!--type=misc-->
Node has several modules compiled into the binary. These modules are io.js has several modules compiled into the binary. These modules are
described in greater detail elsewhere in this documentation. described in greater detail elsewhere in this documentation.
The core modules are defined in node's source in the `lib/` folder. The core modules are defined in io.js's source in the `lib/` folder.
Core modules are always preferentially loaded if their identifier is Core modules are always preferentially loaded if their identifier is
passed to `require()`. For instance, `require('http')` will always passed to `require()`. For instance, `require('http')` will always
@ -130,7 +130,7 @@ return the built in HTTP module, even if there is a file by that name.
<!--type=misc--> <!--type=misc-->
If the exact filename is not found, then node will attempt to load the If the exact filename is not found, then io.js will attempt to load the
required filename with the added extension of `.js`, `.json`, and then `.node`. required filename with the added extension of `.js`, `.json`, and then `.node`.
`.js` files are interpreted as JavaScript text files, and `.json` files are `.js` files are interpreted as JavaScript text files, and `.json` files are
@ -156,7 +156,7 @@ If the given path does not exist, `require()` will throw an Error with its
<!--type=misc--> <!--type=misc-->
If the module identifier passed to `require()` is not a native module, If the module identifier passed to `require()` is not a native module,
and does not begin with `'/'`, `'../'`, or `'./'`, then node starts at the and does not begin with `'/'`, `'../'`, or `'./'`, then io.js starts at the
parent directory of the current module, and adds `/node_modules`, and parent directory of the current module, and adds `/node_modules`, and
attempts to load the module from that location. attempts to load the module from that location.
@ -164,7 +164,7 @@ If it is not found there, then it moves to the parent directory, and so
on, until the root of the file system is reached. on, until the root of the file system is reached.
For example, if the file at `'/home/ry/projects/foo.js'` called For example, if the file at `'/home/ry/projects/foo.js'` called
`require('bar.js')`, then node would look in the following locations, in `require('bar.js')`, then io.js would look in the following locations, in
this order: this order:
* `/home/ry/projects/node_modules/bar.js` * `/home/ry/projects/node_modules/bar.js`
@ -201,9 +201,9 @@ If this was in a folder at `./some-library`, then
`require('./some-library')` would attempt to load `require('./some-library')` would attempt to load
`./some-library/lib/some-library.js`. `./some-library/lib/some-library.js`.
This is the extent of Node's awareness of package.json files. This is the extent of io.js's awareness of package.json files.
If there is no package.json file present in the directory, then node If there is no package.json file present in the directory, then io.js
will attempt to load an `index.js` or `index.node` file out of that will attempt to load an `index.js` or `index.node` file out of that
directory. For example, if there was no package.json file in the above directory. For example, if there was no package.json file in the above
example, then `require('./some-library')` would attempt to load: example, then `require('./some-library')` would attempt to load:
@ -425,17 +425,17 @@ in pseudocode of what require.resolve does:
<!-- type=misc --> <!-- type=misc -->
If the `NODE_PATH` environment variable is set to a colon-delimited list If the `NODE_PATH` environment variable is set to a colon-delimited list
of absolute paths, then node will search those paths for modules if they of absolute paths, then io.js will search those paths for modules if they
are not found elsewhere. (Note: On Windows, `NODE_PATH` is delimited by are not found elsewhere. (Note: On Windows, `NODE_PATH` is delimited by
semicolons instead of colons.) semicolons instead of colons.)
Additionally, node will search in the following locations: Additionally, io.js will search in the following locations:
* 1: `$HOME/.node_modules` * 1: `$HOME/.node_modules`
* 2: `$HOME/.node_libraries` * 2: `$HOME/.node_libraries`
* 3: `$PREFIX/lib/node` * 3: `$PREFIX/lib/node`
Where `$HOME` is the user's home directory, and `$PREFIX` is node's Where `$HOME` is the user's home directory, and `$PREFIX` is io.js's
configured `node_prefix`. configured `node_prefix`.
These are mostly for historic reasons. You are highly encouraged to These are mostly for historic reasons. You are highly encouraged to
@ -446,13 +446,13 @@ loaded faster, and more reliably.
<!-- type=misc --> <!-- type=misc -->
When a file is run directly from Node, `require.main` is set to its When a file is run directly from io.js, `require.main` is set to its
`module`. That means that you can determine whether a file has been run `module`. That means that you can determine whether a file has been run
directly by testing directly by testing
require.main === module require.main === module
For a file `foo.js`, this will be `true` if run via `node foo.js`, but For a file `foo.js`, this will be `true` if run via `iojs foo.js`, but
`false` if run by `require('./foo')`. `false` if run by `require('./foo')`.
Because `module` provides a `filename` property (normally equivalent to Because `module` provides a `filename` property (normally equivalent to
@ -463,10 +463,10 @@ by checking `require.main.filename`.
<!-- type=misc --> <!-- type=misc -->
The semantics of Node's `require()` function were designed to be general The semantics of io.js's `require()` function were designed to be general
enough to support a number of sane directory structures. Package manager enough to support a number of sane directory structures. Package manager
programs such as `dpkg`, `rpm`, and `npm` will hopefully find it possible to programs such as `dpkg`, `rpm`, and `npm` will hopefully find it possible to
build native packages from Node modules without modification. build native packages from io.js modules without modification.
Below we give a suggested directory structure that could work: Below we give a suggested directory structure that could work:
@ -479,7 +479,7 @@ may have to install a specific version of package `bar`. The `bar` package
may itself have dependencies, and in some cases, these dependencies may even may itself have dependencies, and in some cases, these dependencies may even
collide or form cycles. collide or form cycles.
Since Node looks up the `realpath` of any modules it loads (that is, Since io.js looks up the `realpath` of any modules it loads (that is,
resolves symlinks), and then looks for their dependencies in the resolves symlinks), and then looks for their dependencies in the
`node_modules` folders as described above, this situation is very simple to `node_modules` folders as described above, this situation is very simple to
resolve with the following architecture: resolve with the following architecture:
@ -504,10 +504,10 @@ the version that is symlinked into
Furthermore, to make the module lookup process even more optimal, rather Furthermore, to make the module lookup process even more optimal, rather
than putting packages directly in `/usr/lib/node`, we could put them in than putting packages directly in `/usr/lib/node`, we could put them in
`/usr/lib/node_modules/<name>/<version>`. Then node will not bother `/usr/lib/node_modules/<name>/<version>`. Then io.js will not bother
looking for missing dependencies in `/usr/node_modules` or `/node_modules`. looking for missing dependencies in `/usr/node_modules` or `/node_modules`.
In order to make modules available to the node REPL, it might be useful to In order to make modules available to the io.js REPL, it might be useful to
also add the `/usr/lib/node_modules` folder to the `$NODE_PATH` environment also add the `/usr/lib/node_modules` folder to the `$NODE_PATH` environment
variable. Since the module lookups using `node_modules` folders are all variable. Since the module lookups using `node_modules` folders are all
relative, and based on the real path of the files making the calls to relative, and based on the real path of the files making the calls to

6
doc/api/net.markdown

@ -167,7 +167,7 @@ would be to wait a second and then try again. This can be done with
} }
}); });
(Note: All sockets in Node set `SO_REUSEADDR` already) (Note: All sockets in io.js set `SO_REUSEADDR` already)
### server.listen(path[, callback]) ### server.listen(path[, callback])
@ -340,7 +340,7 @@ following this event. See example in discussion of `server.listen`.
This object is an abstraction of a TCP or local socket. `net.Socket` This object is an abstraction of a TCP or local socket. `net.Socket`
instances implement a duplex Stream interface. They can be created by the instances implement a duplex Stream interface. They can be created by the
user and used as a client (with `connect()`) or they can be created by Node user and used as a client (with `connect()`) or they can be created by io.js
and passed to the user through the `'connection'` event of a server. and passed to the user through the `'connection'` event of a server.
### new net.Socket([options]) ### new net.Socket([options])
@ -384,7 +384,7 @@ The `connectListener` parameter will be added as an listener for the
`net.Socket` has the property that `socket.write()` always works. This is to `net.Socket` has the property that `socket.write()` always works. This is to
help users get up and running quickly. The computer cannot always keep up help users get up and running quickly. The computer cannot always keep up
with the amount of data that is written to a socket - the network connection with the amount of data that is written to a socket - the network connection
simply might be too slow. Node will internally queue up the data written to a simply might be too slow. io.js will internally queue up the data written to a
socket and send it out over the wire when it is possible. (Internally it is socket and send it out over the wire when it is possible. (Internally it is
polling on the socket's file descriptor for being writable). polling on the socket's file descriptor for being writable).

8
doc/api/path.markdown

@ -75,8 +75,8 @@ Examples:
'/tmp/file' '/tmp/file'
path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif') path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif')
// if currently in /home/myself/node, it returns // if currently in /home/myself/iojs, it returns
'/home/myself/node/wwwroot/static_files/gif/image.gif' '/home/myself/iojs/wwwroot/static_files/gif/image.gif'
## path.isAbsolute(path) ## path.isAbsolute(path)
@ -196,11 +196,11 @@ An example on *nix:
An example on Windows: An example on Windows:
console.log(process.env.PATH) console.log(process.env.PATH)
// 'C:\Windows\system32;C:\Windows;C:\Program Files\nodejs\' // 'C:\Windows\system32;C:\Windows;C:\Program Files\iojs\'
process.env.PATH.split(path.delimiter) process.env.PATH.split(path.delimiter)
// returns // returns
['C:\Windows\system32', 'C:\Windows', 'C:\Program Files\nodejs\'] ['C:\Windows\system32', 'C:\Windows', 'C:\Program Files\iojs\']
## path.parse(pathString) ## path.parse(pathString)

98
doc/api/process.markdown

@ -7,7 +7,7 @@ It is an instance of [EventEmitter][].
## Exit Codes ## Exit Codes
Node will normally exit with a `0` status code when no more async io.js will normally exit with a `0` status code when no more async
operations are pending. The following status codes are used in other operations are pending. The following status codes are used in other
cases: cases:
@ -16,13 +16,13 @@ cases:
handler. handler.
* `2` - Unused (reserved by Bash for builtin misuse) * `2` - Unused (reserved by Bash for builtin misuse)
* `3` **Internal JavaScript Parse Error** - The JavaScript source code * `3` **Internal JavaScript Parse Error** - The JavaScript source code
internal in Node's bootstrapping process caused a parse error. This internal in io.js's bootstrapping process caused a parse error. This
is extremely rare, and generally can only happen during development is extremely rare, and generally can only happen during development
of Node itself. of io.js itself.
* `4` **Internal JavaScript Evaluation Failure** - The JavaScript * `4` **Internal JavaScript Evaluation Failure** - The JavaScript
source code internal in Node's bootstrapping process failed to source code internal in io.js's bootstrapping process failed to
return a function value when evaluated. This is extremely rare, and return a function value when evaluated. This is extremely rare, and
generally can only happen during development of Node itself. generally can only happen during development of io.js itself.
* `5` **Fatal Error** - There was a fatal unrecoverable error in V8. * `5` **Fatal Error** - There was a fatal unrecoverable error in V8.
Typically a message will be printed to stderr with the prefix `FATAL Typically a message will be printed to stderr with the prefix `FATAL
ERROR`. ERROR`.
@ -34,17 +34,17 @@ cases:
function itself threw an error while attempting to handle it. This function itself threw an error while attempting to handle it. This
can happen, for example, if a `process.on('uncaughtException')` or can happen, for example, if a `process.on('uncaughtException')` or
`domain.on('error')` handler throws an error. `domain.on('error')` handler throws an error.
* `8` - Unused. In previous versions of Node, exit code 8 sometimes * `8` - Unused. In previous versions of io.js, exit code 8 sometimes
indicated an uncaught exception. indicated an uncaught exception.
* `9` - **Invalid Argument** - Either an unknown option was specified, * `9` - **Invalid Argument** - Either an unknown option was specified,
or an option requiring a value was provided without a value. or an option requiring a value was provided without a value.
* `10` **Internal JavaScript Run-Time Failure** - The JavaScript * `10` **Internal JavaScript Run-Time Failure** - The JavaScript
source code internal in Node's bootstrapping process threw an error source code internal in io.js's bootstrapping process threw an error
when the bootstrapping function was called. This is extremely rare, when the bootstrapping function was called. This is extremely rare,
and generally can only happen during development of Node itself. and generally can only happen during development of io.js itself.
* `12` **Invalid Debug Argument** - The `--debug` and/or `--debug-brk` * `12` **Invalid Debug Argument** - The `--debug` and/or `--debug-brk`
options were set, but an invalid port number was chosen. options were set, but an invalid port number was chosen.
* `>128` **Signal Exits** - If Node receives a fatal signal such as * `>128` **Signal Exits** - If io.js receives a fatal signal such as
`SIGKILL` or `SIGHUP`, then its exit code will be `128` plus the `SIGKILL` or `SIGHUP`, then its exit code will be `128` plus the
value of the signal code. This is a standard Unix practice, since value of the signal code. This is a standard Unix practice, since
exit codes are defined to be 7-bit integers, and signal exits set exit codes are defined to be 7-bit integers, and signal exits set
@ -72,9 +72,9 @@ Example of listening for `exit`:
## Event: 'beforeExit' ## Event: 'beforeExit'
This event is emitted when node empties it's event loop and has nothing else to This event is emitted when io.js empties it's event loop and has nothing else to
schedule. Normally, node exits when there is no work scheduled, but a listener schedule. Normally, io.js exits when there is no work scheduled, but a listener
for 'beforeExit' can make asynchronous calls, and cause node to continue. for 'beforeExit' can make asynchronous calls, and cause io.js to continue.
'beforeExit' is not emitted for conditions causing explicit termination, such as 'beforeExit' is not emitted for conditions causing explicit termination, such as
`process.exit()` or uncaught exceptions, and should not be used as an `process.exit()` or uncaught exceptions, and should not be used as an
@ -107,8 +107,8 @@ handling.
Don't use it, use [domains](domain.html) instead. If you do use it, restart Don't use it, use [domains](domain.html) instead. If you do use it, restart
your application after every unhandled exception! your application after every unhandled exception!
Do *not* use it as the node.js equivalent of `On Error Resume Next`. An Do *not* use it as the io.js equivalent of `On Error Resume Next`. An
unhandled exception means your application - and by extension node.js itself - unhandled exception means your application - and by extension io.js itself -
is in an undefined state. Blindly resuming means *anything* could happen. is in an undefined state. Blindly resuming means *anything* could happen.
Think of resuming as pulling the power cord when you are upgrading your system. Think of resuming as pulling the power cord when you are upgrading your system.
@ -138,19 +138,19 @@ programs.
Note: Note:
- `SIGUSR1` is reserved by node.js to start the debugger. It's possible to - `SIGUSR1` is reserved by io.js to start the debugger. It's possible to
install a listener but that won't stop the debugger from starting. install a listener but that won't stop the debugger from starting.
- `SIGTERM` and `SIGINT` have default handlers on non-Windows platforms that resets - `SIGTERM` and `SIGINT` have default handlers on non-Windows platforms that resets
the terminal mode before exiting with code `128 + signal number`. If one of the terminal mode before exiting with code `128 + signal number`. If one of
these signals has a listener installed, its default behaviour will be removed these signals has a listener installed, its default behaviour will be removed
(node will no longer exit). (io.js will no longer exit).
- `SIGPIPE` is ignored by default, it can have a listener installed. - `SIGPIPE` is ignored by default, it can have a listener installed.
- `SIGHUP` is generated on Windows when the console window is closed, and on other - `SIGHUP` is generated on Windows when the console window is closed, and on other
platforms under various similar conditions, see signal(7). It can have a platforms under various similar conditions, see signal(7). It can have a
listener installed, however node will be unconditionally terminated by Windows listener installed, however io.js will be unconditionally terminated by
about 10 seconds later. On non-Windows platforms, the default behaviour of Windows about 10 seconds later. On non-Windows platforms, the default
`SIGHUP` is to terminate node, but once a listener has been installed its behaviour of `SIGHUP` is to terminate io.js, but once a listener has been
default behaviour will be removed. installed its default behaviour will be removed.
- `SIGTERM` is not supported on Windows, it can be listened on. - `SIGTERM` is not supported on Windows, it can be listened on.
- `SIGINT` from the terminal is supported on all platforms, and can usually be - `SIGINT` from the terminal is supported on all platforms, and can usually be
generated with `CTRL+C` (though this may be configurable). It is not generated generated with `CTRL+C` (though this may be configurable). It is not generated
@ -161,10 +161,10 @@ Note:
only happen on write to the console when the cursor is being moved, or when a only happen on write to the console when the cursor is being moved, or when a
readable tty is used in raw mode. readable tty is used in raw mode.
- `SIGKILL` cannot have a listener installed, it will unconditionally terminate - `SIGKILL` cannot have a listener installed, it will unconditionally terminate
node on all platforms. io.js on all platforms.
- `SIGSTOP` cannot have a listener installed. - `SIGSTOP` cannot have a listener installed.
Note that Windows does not support sending Signals, but node offers some Note that Windows does not support sending Signals, but io.js offers some
emulation with `process.kill()`, and `child_process.kill()`: emulation with `process.kill()`, and `child_process.kill()`:
- Sending signal `0` can be used to search for the existence of a process - Sending signal `0` can be used to search for the existence of a process
- Sending `SIGINT`, `SIGTERM`, and `SIGKILL` cause the unconditional exit of the - Sending `SIGINT`, `SIGTERM`, and `SIGKILL` cause the unconditional exit of the
@ -180,7 +180,7 @@ Example: the definition of `console.log`
process.stdout.write(d + '\n'); process.stdout.write(d + '\n');
}; };
`process.stderr` and `process.stdout` are unlike other streams in Node in `process.stderr` and `process.stdout` are unlike other streams in io.js in
that they cannot be closed (`end()` will throw), they never emit the `finish` that they cannot be closed (`end()` will throw), they never emit the `finish`
event and that writes are usually blocking. event and that writes are usually blocking.
@ -190,17 +190,17 @@ event and that writes are usually blocking.
- They are blocking in Linux/Unix. - They are blocking in Linux/Unix.
- They are non-blocking like other streams in Windows. - They are non-blocking like other streams in Windows.
To check if Node is being run in a TTY context, read the `isTTY` property To check if io.js is being run in a TTY context, read the `isTTY` property
on `process.stderr`, `process.stdout`, or `process.stdin`: on `process.stderr`, `process.stdout`, or `process.stdin`:
$ node -p "Boolean(process.stdin.isTTY)" $ iojs -p "Boolean(process.stdin.isTTY)"
true true
$ echo "foo" | node -p "Boolean(process.stdin.isTTY)" $ echo "foo" | iojs -p "Boolean(process.stdin.isTTY)"
false false
$ node -p "Boolean(process.stdout.isTTY)" $ iojs -p "Boolean(process.stdout.isTTY)"
true true
$ node -p "Boolean(process.stdout.isTTY)" | cat $ iojs -p "Boolean(process.stdout.isTTY)" | cat
false false
See [the tty docs](tty.html#tty_tty) for more information. See [the tty docs](tty.html#tty_tty) for more information.
@ -209,7 +209,7 @@ See [the tty docs](tty.html#tty_tty) for more information.
A writable stream to stderr (on fd `2`). A writable stream to stderr (on fd `2`).
`process.stderr` and `process.stdout` are unlike other streams in Node in `process.stderr` and `process.stdout` are unlike other streams in io.js in
that they cannot be closed (`end()` will throw), they never emit the `finish` that they cannot be closed (`end()` will throw), they never emit the `finish`
event and that writes are usually blocking. event and that writes are usually blocking.
@ -240,7 +240,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 As a Stream, `process.stdin` can also be used in "old" mode that is compatible
with scripts written for node prior v0.10. with scripts written for node.js prior to v0.10.
For more information see For more information see
[Stream compatibility](stream.html#stream_compatibility_with_older_node_versions). [Stream compatibility](stream.html#stream_compatibility_with_older_node_versions).
@ -254,7 +254,7 @@ mode over "old" one.
## process.argv ## process.argv
An array containing the command line arguments. The first element will be An array containing the command line arguments. The first element will be
'node', the second element will be the name of the JavaScript file. The 'iojs', the second element will be the name of the JavaScript file. The
next elements will be any additional command line arguments. next elements will be any additional command line arguments.
// print process.argv // print process.argv
@ -264,9 +264,9 @@ next elements will be any additional command line arguments.
This will generate: This will generate:
$ node process-2.js one two=three four $ iojs process-2.js one two=three four
0: node 0: iojs
1: /Users/mjr/work/node/process-2.js 1: /Users/mjr/work/iojs/process-2.js
2: one 2: one
3: two=three 3: two=three
4: four 4: four
@ -278,21 +278,21 @@ This is the absolute pathname of the executable that started the process.
Example: Example:
/usr/local/bin/node /usr/local/bin/iojs
## process.execArgv ## process.execArgv
This is the set of node-specific command line options from the This is the set of io.js-specific command line options from the
executable that started the process. These options do not show up in executable that started the process. These options do not show up in
`process.argv`, and do not include the node executable, the name of `process.argv`, and do not include the io.js executable, the name of
the script, or any options following the script name. These options the script, or any options following the script name. These options
are useful in order to spawn child processes with the same execution are useful in order to spawn child processes with the same execution
environment as the parent. environment as the parent.
Example: Example:
$ node --harmony script.js --version $ iojs --harmony script.js --version
results in process.execArgv: results in process.execArgv:
@ -300,12 +300,12 @@ results in process.execArgv:
and process.argv: and process.argv:
['/usr/local/bin/node', 'script.js', '--version'] ['/usr/local/bin/iojs', 'script.js', '--version']
## process.abort() ## process.abort()
This causes node to emit an abort. This will cause node to exit and This causes io.js to emit an abort. This will cause io.js to exit and
generate a core file. generate a core file.
## process.chdir(directory) ## process.chdir(directory)
@ -345,12 +345,12 @@ An example of this object looks like:
SHLVL: '1', SHLVL: '1',
HOME: '/Users/maciej', HOME: '/Users/maciej',
LOGNAME: 'maciej', LOGNAME: 'maciej',
_: '/usr/local/bin/node' } _: '/usr/local/bin/iojs' }
You can write to this object, but changes won't be reflected outside of your You can write to this object, but changes won't be reflected outside of your
process. That means that the following won't work: process. That means that the following won't work:
node -e 'process.env.foo = "bar"' && echo $foo $ iojs -e 'process.env.foo = "bar"' && echo $foo
But this will: But this will:
@ -367,7 +367,7 @@ To exit with a 'failure' code:
process.exit(1); process.exit(1);
The shell that executed node should see the exit code as 1. The shell that executed io.js should see the exit code as 1.
## process.exitCode ## process.exitCode
@ -454,7 +454,7 @@ Note: this function is only available on POSIX platforms (i.e. not Windows,
Android) Android)
Returns an array with the supplementary group IDs. POSIX leaves it unspecified Returns an array with the supplementary group IDs. POSIX leaves it unspecified
if the effective group ID is included but node.js ensures it always is. if the effective group ID is included but io.js ensures it always is.
## process.setgroups(groups) ## process.setgroups(groups)
@ -496,7 +496,7 @@ A compiled-in property that exposes `NODE_VERSION`.
## process.versions ## process.versions
A property exposing version strings of node and its dependencies. A property exposing version strings of io.js and its dependencies.
console.log(process.versions); console.log(process.versions);
@ -514,7 +514,7 @@ Will print something like:
## process.config ## process.config
An Object containing the JavaScript representation of the configure options An Object containing the JavaScript representation of the configure options
that were used to compile the current node executable. This is the same as that were used to compile the current io.js executable. This is the same as
the "config.gypi" file that was produced when running the `./configure` script. the "config.gypi" file that was produced when running the `./configure` script.
An example of the possible output looks like: An example of the possible output looks like:
@ -568,7 +568,7 @@ Example of sending a signal to yourself:
process.kill(process.pid, 'SIGHUP'); process.kill(process.pid, 'SIGHUP');
Note: When SIGUSR1 is received by Node.js it starts the debugger, see Note: When SIGUSR1 is received by io.js it starts the debugger, see
[Signal Events](#process_signal_events). [Signal Events](#process_signal_events).
## process.pid ## process.pid
@ -610,7 +610,7 @@ What platform you're running on:
## process.memoryUsage() ## process.memoryUsage()
Returns an object describing the memory usage of the Node process Returns an object describing the memory usage of the io.js process
measured in bytes. measured in bytes.
var util = require('util'); var util = require('util');
@ -717,7 +717,7 @@ given, otherwise returns the current mask.
## process.uptime() ## process.uptime()
Number of seconds Node has been running. Number of seconds io.js has been running.
## process.hrtime() ## process.hrtime()

2
doc/api/punycode.markdown

@ -4,7 +4,7 @@
[Punycode.js](https://mths.be/punycode) is bundled with io.js v1.0.0+ and [Punycode.js](https://mths.be/punycode) is bundled with io.js v1.0.0+ and
Node.js v0.6.2+. Use `require('punycode')` to access it. (To use it 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.) other io.js versions, use npm to install the `punycode` module first.)
## punycode.decode(string) ## punycode.decode(string)

8
doc/api/readline.markdown

@ -5,7 +5,7 @@
To use this module, do `require('readline')`. Readline allows reading of a To use this module, do `require('readline')`. Readline allows reading of a
stream (such as `process.stdin`) on a line-by-line basis. stream (such as `process.stdin`) on a line-by-line basis.
Note that once you've invoked this module, your node program will not Note that once you've invoked this module, your io.js program will not
terminate until you've closed the interface. Here's how to allow your terminate until you've closed the interface. Here's how to allow your
program to gracefully exit: program to gracefully exit:
@ -16,7 +16,7 @@ program to gracefully exit:
output: process.stdout output: process.stdout
}); });
rl.question("What do you think of node.js? ", function(answer) { rl.question("What do you think of io.js? ", function(answer) {
// TODO: Log the answer in a database // TODO: Log the answer in a database
console.log("Thank you for your valuable feedback:", answer); console.log("Thank you for your valuable feedback:", answer);
@ -88,8 +88,8 @@ stream.
### rl.setPrompt(prompt) ### rl.setPrompt(prompt)
Sets the prompt, for example when you run `node` on the command line, you see Sets the prompt, for example when you run `iojs` on the command line, you see
`> `, which is node's prompt. `> `, which is io.js's prompt.
### rl.prompt([preserveCursor]) ### rl.prompt([preserveCursor])

22
doc/api/repl.markdown

@ -7,10 +7,10 @@ easily includable in other programs. The REPL provides a way to interactively
run JavaScript and see the results. It can be used for debugging, testing, or run JavaScript and see the results. It can be used for debugging, testing, or
just trying things out. just trying things out.
By executing `node` without any arguments from the command-line you will be By executing `iojs` without any arguments from the command-line you will be
dropped into the REPL. It has simplistic emacs line-editing. dropped into the REPL. It has simplistic emacs line-editing.
mjr:~$ node mjr:~$ iojs
Type '.help' for options. Type '.help' for options.
> a = [ 1, 2, 3]; > a = [ 1, 2, 3];
[ 1, 2, 3 ] [ 1, 2, 3 ]
@ -21,13 +21,13 @@ dropped into the REPL. It has simplistic emacs line-editing.
2 2
3 3
For advanced line-editors, start node with the environmental variable For advanced line-editors, start io.js with the environmental variable
`NODE_NO_READLINE=1`. This will start the main and debugger REPL in canonical `NODE_NO_READLINE=1`. This will start the main and debugger REPL in canonical
terminal settings which will allow you to use with `rlwrap`. terminal settings which will allow you to use with `rlwrap`.
For example, you could add this to your bashrc file: For example, you could add this to your bashrc file:
alias node="env NODE_NO_READLINE=1 rlwrap node" alias iojs="env NODE_NO_READLINE=1 rlwrap iojs"
## repl.start(options) ## repl.start(options)
@ -70,7 +70,7 @@ You can use your own `eval` function if it has following signature:
callback(null, result); callback(null, result);
} }
Multiple REPLs may be started against the same running instance of node. Each Multiple REPLs may be started against the same running instance of io.js. Each
will share the same global object but will have unique I/O. will share the same global object but will have unique I/O.
Here is an example that starts a REPL on stdin, a Unix socket, and a TCP socket: Here is an example that starts a REPL on stdin, a Unix socket, and a TCP socket:
@ -81,7 +81,7 @@ Here is an example that starts a REPL on stdin, a Unix socket, and a TCP socket:
connections = 0; connections = 0;
repl.start({ repl.start({
prompt: "node via stdin> ", prompt: "io.js via stdin> ",
input: process.stdin, input: process.stdin,
output: process.stdout output: process.stdout
}); });
@ -89,18 +89,18 @@ Here is an example that starts a REPL on stdin, a Unix socket, and a TCP socket:
net.createServer(function (socket) { net.createServer(function (socket) {
connections += 1; connections += 1;
repl.start({ repl.start({
prompt: "node via Unix socket> ", prompt: "io.js via Unix socket> ",
input: socket, input: socket,
output: socket output: socket
}).on('exit', function() { }).on('exit', function() {
socket.end(); socket.end();
}) })
}).listen("/tmp/node-repl-sock"); }).listen("/tmp/iojs-repl-sock");
net.createServer(function (socket) { net.createServer(function (socket) {
connections += 1; connections += 1;
repl.start({ repl.start({
prompt: "node via TCP socket> ", prompt: "io.js via TCP socket> ",
input: socket, input: socket,
output: socket output: socket
}).on('exit', function() { }).on('exit', function() {
@ -114,7 +114,7 @@ for connecting to TCP sockets, and `socat` can be used to connect to both Unix a
TCP sockets. TCP sockets.
By starting a REPL from a Unix socket-based server instead of stdin, you can By starting a REPL from a Unix socket-based server instead of stdin, you can
connect to a long-running node process without restarting it. connect to a long-running io.js process without restarting it.
For an example of running a "full-featured" (`terminal`) REPL over For an example of running a "full-featured" (`terminal`) REPL over
a `net.Server` and `net.Socket` instance, see: https://gist.github.com/2209310 a `net.Server` and `net.Socket` instance, see: https://gist.github.com/2209310
@ -187,7 +187,7 @@ associated with each `REPLServer`. For example:
Things in the `context` object appear as local within the REPL: Things in the `context` object appear as local within the REPL:
mjr:~$ node repl_test.js mjr:~$ iojs repl_test.js
> m > m
'message' 'message'

34
doc/api/stream.markdown

@ -3,7 +3,7 @@
Stability: 2 - Unstable Stability: 2 - Unstable
A stream is an abstract interface implemented by various objects in A stream is an abstract interface implemented by various objects in
Node. For example a [request to an HTTP io.js. For example a [request to an HTTP
server](http.html#http_http_incomingmessage) is a stream, as is server](http.html#http_http_incomingmessage) is a stream, as is
[stdout][]. Streams are readable, writable, or both. All streams are [stdout][]. Streams are readable, writable, or both. All streams are
instances of [EventEmitter][] instances of [EventEmitter][]
@ -47,8 +47,8 @@ streams in your programs. If you **are** implementing streaming
interfaces in your own program, please also refer to interfaces in your own program, please also refer to
[API for Stream Implementors][] below. [API for Stream Implementors][] below.
Almost all Node programs, no matter how simple, use Streams in some Almost all io.js programs, no matter how simple, use Streams in some
way. Here is an example of using Streams in a Node program: way. Here is an example of using Streams in an io.js program:
```javascript ```javascript
var http = require('http'); var http = require('http');
@ -457,17 +457,17 @@ function parseHeader(stream, callback) {
* `stream` {Stream} An "old style" readable stream * `stream` {Stream} An "old style" readable stream
Versions of Node prior to v0.10 had streams that did not implement the Versions of Node.js prior to v0.10 had streams that did not implement the
entire Streams API as it is today. (See "Compatibility" below for entire Streams API as it is today. (See "Compatibility" below for
more information.) more information.)
If you are using an older Node library that emits `'data'` events and If you are using an older io.js library that emits `'data'` events and
has a [`pause()`][] method that is advisory only, then you can use the has a [`pause()`][] method that is advisory only, then you can use the
`wrap()` method to create a [Readable][] stream that uses the old stream `wrap()` method to create a [Readable][] stream that uses the old stream
as its data source. as its data source.
You will very rarely ever need to call this function, but it exists You will very rarely ever need to call this function, but it exists
as a convenience for interacting with old Node programs and libraries. as a convenience for interacting with old io.js programs and libraries.
For example: For example:
@ -1235,7 +1235,7 @@ simply by using the higher level [Transform][] stream class, similar to
the `parseHeader` and `SimpleProtocol v1` examples above. the `parseHeader` and `SimpleProtocol v1` examples above.
In this example, rather than providing the input as an argument, it In this example, rather than providing the input as an argument, it
would be piped into the parser, which is a more idiomatic Node stream would be piped into the parser, which is a more idiomatic io.js stream
approach. approach.
```javascript ```javascript
@ -1425,7 +1425,7 @@ stream is not currently reading, then calling `read(0)` will trigger
a low-level `_read` call. a low-level `_read` call.
There is almost never a need to do this. However, you will see some There is almost never a need to do this. However, you will see some
cases in Node's internals where this is done, particularly in the cases in io.js's internals where this is done, particularly in the
Readable stream class internals. Readable stream class internals.
### `stream.push('')` ### `stream.push('')`
@ -1442,16 +1442,16 @@ code) will know when to check again, by calling `stream.read(0)`. In
those cases, you *may* call `stream.push('')`. those cases, you *may* call `stream.push('')`.
So far, the only use case for this functionality is in the So far, the only use case for this functionality is in the
[tls.CryptoStream][] class, which is deprecated in Node v0.12. If you [tls.CryptoStream][] class, which is deprecated in io.js v1.0. If you
find that you have to use `stream.push('')`, please consider another find that you have to use `stream.push('')`, please consider another
approach, because it almost certainly indicates that something is approach, because it almost certainly indicates that something is
horribly wrong. horribly wrong.
### Compatibility with Older Node Versions ### Compatibility with Older Node.js Versions
<!--type=misc--> <!--type=misc-->
In versions of Node prior to v0.10, the Readable stream interface was In versions of Node.js prior to v0.10, the Readable stream interface was
simpler, but also less powerful and less useful. simpler, but also less powerful and less useful.
* Rather than waiting for you to call the `read()` method, `'data'` * Rather than waiting for you to call the `read()` method, `'data'`
@ -1462,8 +1462,8 @@ simpler, but also less powerful and less useful.
meant that you still had to be prepared to receive `'data'` events meant that you still had to be prepared to receive `'data'` events
even when the stream was in a paused state. even when the stream was in a paused state.
In Node v0.10, the Readable class described below was added. For In io.js v1.0 and Node.js v0.10, the Readable class described below was added.
backwards compatibility with older Node programs, Readable streams For backwards compatibility with older Node.js programs, Readable streams
switch into "flowing mode" when a `'data'` event handler is added, or switch into "flowing mode" when a `'data'` event handler is added, or
when the [`resume()`][] method is called. The effect is that, even if when the [`resume()`][] method is called. The effect is that, even if
you are not using the new `read()` method and `'readable'` event, you you are not using the new `read()` method and `'readable'` event, you
@ -1491,9 +1491,9 @@ net.createServer(function(socket) {
}).listen(1337); }).listen(1337);
``` ```
In versions of node prior to v0.10, the incoming message data would be In versions of Node.js prior to v0.10, the incoming message data would be
simply discarded. However, in Node v0.10 and beyond, the socket will simply discarded. However, in io.js v1.0 and Node.js v0.10 and beyond,
remain paused forever. the socket will remain paused forever.
The workaround in this situation is to call the `resume()` method to The workaround in this situation is to call the `resume()` method to
start the flow of data: start the flow of data:
@ -1539,7 +1539,7 @@ return value from `stream.read()` indicates that there is no more
data, and [`stream.push(null)`][] will signal the end of stream data data, and [`stream.push(null)`][] will signal the end of stream data
(`EOF`). (`EOF`).
No streams in Node core are object mode streams. This pattern is only No streams in io.js core are object mode streams. This pattern is only
used by userland streaming libraries. used by userland streaming libraries.
You should set `objectMode` in your stream child class constructor on You should set `objectMode` in your stream child class constructor on

8
doc/api/synopsis.markdown

@ -2,8 +2,8 @@
<!--type=misc--> <!--type=misc-->
An example of a [web server](http.html) written with Node which responds with 'Hello An example of a [web server](http.html) written with io.js which responds with
World': 'Hello World':
var http = require('http'); var http = require('http');
@ -15,9 +15,9 @@ World':
console.log('Server running at http://127.0.0.1:8124/'); console.log('Server running at http://127.0.0.1:8124/');
To run the server, put the code into a file called `example.js` and execute To run the server, put the code into a file called `example.js` and execute
it with the node program it with the iojs program
> node example.js > iojs example.js
Server running at http://127.0.0.1:8124/ Server running at http://127.0.0.1:8124/
All of the examples in the documentation can be run similarly. All of the examples in the documentation can be run similarly.

2
doc/api/timers.markdown

@ -12,7 +12,7 @@ To schedule execution of a one-time `callback` after `delay` milliseconds. Retur
also pass arguments to the callback. also pass arguments to the callback.
It is important to note that your callback will probably not be called in exactly It is important to note that your callback will probably not be called in exactly
`delay` milliseconds - Node.js makes no guarantees about the exact timing of when `delay` milliseconds - io.js makes no guarantees about the exact timing of when
the callback will fire, nor of the ordering things will fire in. The callback will the callback will fire, nor of the ordering things will fire in. The callback will
be called as close as possible to the time specified. be called as close as possible to the time specified.

8
doc/api/tls.markdown

@ -148,7 +148,7 @@ automatically set as a listener for the [secureConnection][] event. The
on the format. on the format.
`ECDHE-RSA-AES128-SHA256`, `DHE-RSA-AES128-SHA256` and `ECDHE-RSA-AES128-SHA256`, `DHE-RSA-AES128-SHA256` and
`AES128-GCM-SHA256` are TLS v1.2 ciphers and used when node.js is `AES128-GCM-SHA256` are TLS v1.2 ciphers and used when io.js is
linked against OpenSSL 1.0.1 or newer, such as the bundled version linked against OpenSSL 1.0.1 or newer, such as the bundled version
of OpenSSL. Note that it is still possible for a TLS v1.2 client of OpenSSL. Note that it is still possible for a TLS v1.2 client
to negotiate a weaker cipher unless `honorCipherOrder` is enabled. to negotiate a weaker cipher unless `honorCipherOrder` is enabled.
@ -444,7 +444,7 @@ dictionary with keys:
instead of the client preferences. For further details see `tls` module instead of the client preferences. For further details see `tls` module
documentation. documentation.
If no 'ca' details are given, then node.js will use the default If no 'ca' details are given, then io.js will use the default
publicly trusted list of CAs as given in publicly trusted list of CAs as given in
<http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt>. <http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt>.
@ -695,14 +695,14 @@ Example:
{ C: 'UK', { C: 'UK',
ST: 'Acknack Ltd', ST: 'Acknack Ltd',
L: 'Rhys Jones', L: 'Rhys Jones',
O: 'node.js', O: 'io.js',
OU: 'Test TLS Certificate', OU: 'Test TLS Certificate',
CN: 'localhost' }, CN: 'localhost' },
issuerInfo: issuerInfo:
{ C: 'UK', { C: 'UK',
ST: 'Acknack Ltd', ST: 'Acknack Ltd',
L: 'Rhys Jones', L: 'Rhys Jones',
O: 'node.js', O: 'io.js',
OU: 'Test TLS Certificate', OU: 'Test TLS Certificate',
CN: 'localhost' }, CN: 'localhost' },
issuer: issuer:

12
doc/api/tty.markdown

@ -5,14 +5,14 @@
The `tty` module houses the `tty.ReadStream` and `tty.WriteStream` classes. In The `tty` module houses the `tty.ReadStream` and `tty.WriteStream` classes. In
most cases, you will not need to use this module directly. most cases, you will not need to use this module directly.
When node detects that it is being run inside a TTY context, then `process.stdin` When io.js detects that it is being run inside a TTY context, then `process.stdin`
will be a `tty.ReadStream` instance and `process.stdout` will be will be a `tty.ReadStream` instance and `process.stdout` will be
a `tty.WriteStream` instance. The preferred way to check if node is being run in a `tty.WriteStream` instance. The preferred way to check if io.js is being run
a TTY context is to check `process.stdout.isTTY`: in a TTY context is to check `process.stdout.isTTY`:
$ node -p -e "Boolean(process.stdout.isTTY)" $ iojs -p -e "Boolean(process.stdout.isTTY)"
true true
$ node -p -e "Boolean(process.stdout.isTTY)" | cat $ iojs -p -e "Boolean(process.stdout.isTTY)" | cat
false false
@ -32,7 +32,7 @@ Deprecated. Use `tty.ReadStream#setRawMode()`
A `net.Socket` subclass that represents the readable portion of a tty. In normal A `net.Socket` subclass that represents the readable portion of a tty. In normal
circumstances, `process.stdin` will be the only `tty.ReadStream` instance in any circumstances, `process.stdin` will be the only `tty.ReadStream` instance in any
node program (only when `isatty(0)` is true). io.js program (only when `isatty(0)` is true).
### rs.isRaw ### rs.isRaw

4
doc/api/util.markdown

@ -5,12 +5,12 @@
These functions are in the module `'util'`. Use `require('util')` to These functions are in the module `'util'`. Use `require('util')` to
access them. access them.
The `util` module is primarily designed to support the needs of Node's The `util` module is primarily designed to support the needs of io.js's
internal APIs. Many of these utilities are useful for your own internal APIs. Many of these utilities are useful for your own
programs. If you find that these functions are lacking for your programs. If you find that these functions are lacking for your
purposes, however, you are encouraged to write your own utilities. We purposes, however, you are encouraged to write your own utilities. We
are not interested in any future additions to the `util` module that are not interested in any future additions to the `util` module that
are unnecessary for Node's internal functionality. are unnecessary for io.js's internal functionality.
## util.debuglog(section) ## util.debuglog(section)

4
doc/api/v8.markdown

@ -3,7 +3,7 @@
Stability: 1 - Experimental Stability: 1 - Experimental
This module exposes events and interfaces specific to the version of [V8][] This module exposes events and interfaces specific to the version of [V8][]
built with node. These interfaces are subject to change by upstream and are built with io.js. These interfaces are subject to change by upstream and are
therefore not covered under the stability index. therefore not covered under the stability index.
## getHeapStatistics() ## getHeapStatistics()
@ -26,7 +26,7 @@ Set additional V8 command line flags. Use with care; changing settings
after the VM has started may result in unpredictable behavior, including after the VM has started may result in unpredictable behavior, including
crashes and data loss. Or it may simply do nothing. crashes and data loss. Or it may simply do nothing.
The V8 options available for a version of node may be determined by running The V8 options available for a version of io.js may be determined by running
`iojs --v8-options`. An unofficial, community-maintained list of options `iojs --v8-options`. An unofficial, community-maintained list of options
and their effects is available and their effects is available
[here](https://github.com/thlorenz/v8-flags/blob/master/flags-0.11.md). [here](https://github.com/thlorenz/v8-flags/blob/master/flags-0.11.md).

4
doc/api/zlib.markdown

@ -260,7 +260,7 @@ See the description of `deflateInit2` and `inflateInit2` at
<!--type=misc--> <!--type=misc-->
From `zlib/zconf.h`, modified to node's usage: From `zlib/zconf.h`, modified to io.js's usage:
The memory requirements for deflate are (in bytes): The memory requirements for deflate are (in bytes):
@ -291,7 +291,7 @@ The speed of zlib compression is affected most dramatically by the
will take longer to complete. A lower level will result in less will take longer to complete. A lower level will result in less
compression, but will be much faster. compression, but will be much faster.
In general, greater memory usage options will mean that node has to make In general, greater memory usage options will mean that io.js has to make
fewer calls to zlib, since it'll be able to process more data in a fewer calls to zlib, since it'll be able to process more data in a
single `write` operation. So, this is another factor that affects the single `write` operation. So, this is another factor that affects the
speed, at the cost of memory usage. speed, at the cost of memory usage.

Loading…
Cancel
Save