Skip to content

Commit

Permalink
doc: update node.js references in api docs
Browse files Browse the repository at this point in the history
Fixes: #740
PR-URL: #750
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
bnoordhuis authored and cjihrig committed Feb 7, 2015
1 parent c22e5ac commit 789bbb9
Show file tree
Hide file tree
Showing 30 changed files with 208 additions and 207 deletions.
12 changes: 6 additions & 6 deletions doc/api/addons.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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 source
`v8.h` header file (`deps/v8/include/v8.h` in the io.js source
tree), which is also available
[online](http://izs.me/v8-docs/main.html).

Expand All @@ -16,12 +16,12 @@ knowledge of several libraries:
to interface with libuv. That is, if you perform any I/O, libuv will
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.

- 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
any of these libraries.

Expand Down Expand Up @@ -55,7 +55,7 @@ First we create a file `hello.cc`:

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);
NODE_MODULE(module_name, Initialize)
Expand Down Expand Up @@ -90,7 +90,7 @@ command.
Now you have your compiled `.node` bindings file! The compiled bindings end up
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:

// hello.js
Expand Down Expand Up @@ -564,7 +564,7 @@ Test it with:
### Passing wrapped objects 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
`MyObject` objects:

Expand Down
8 changes: 4 additions & 4 deletions doc/api/buffer.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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
streams. Node has several strategies for manipulating, creating, and
streams. io.js has several strategies for manipulating, creating, and
consuming octet streams.

Raw data is stored in instances of the `Buffer` class. A `Buffer` is similar
Expand Down Expand Up @@ -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
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
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.

Expand Down Expand Up @@ -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:

str = "node.js";
str = "io.js";
buf = new Buffer(str.length);

for (var i = 0; i < str.length ; i++) {
Expand All @@ -304,7 +304,7 @@ Example: copy an ASCII string into a buffer, one byte at a time:

console.log(buf);

// node.js
// io.js

### buf.equals(otherBuffer)

Expand Down
27 changes: 14 additions & 13 deletions doc/api/child_process.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

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.

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
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.)

To create a child process use `require('child_process').spawn()` or
Expand Down Expand Up @@ -61,8 +61,9 @@ of the signal, otherwise `null`.

Note that the child process stdio streams might still be open.

Also, note that node establishes signal handlers for `'SIGINT'` and `'SIGTERM`',
so it will not terminate due to receipt of those signals, it will exit.
Also, note that io.js establishes signal handlers for `'SIGINT'` and
`'SIGTERM`', so it will not terminate due to receipt of those signals,
it will exit.

See `waitpid(2)`.

Expand Down Expand Up @@ -248,7 +249,7 @@ instead, see

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
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
should by all means avoid using this feature, it is subject to change without notice.

Expand Down Expand Up @@ -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
file descriptor. Setting this option enables the ChildProcess.send() method.
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
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
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,
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
Expand Down Expand Up @@ -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).)
* 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
instance, the returned object has a communication channel built-in. See
`child.send(message, [sendHandle])` for details.

These child Nodes are still whole new instances of V8. Assume at least 30ms
startup and 10mb memory for each new Node. That is, you cannot create many
thousands of them.
These child io.js processes are still whole new instances of V8. Assume at
least 30ms startup and 10mb memory for each new io.js. That is, you cannot
create many thousands of them.

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
environmental variable `NODE_CHANNEL_FD` on the child process. The input and
output on this fd is expected to be line delimited JSON objects.
Expand Down
16 changes: 8 additions & 8 deletions doc/api/cluster.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

Stability: 2 - Unstable

A single instance of Node runs in a single thread. To take advantage of
multi-core systems the user will sometimes want to launch a cluster of Node
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 io.js
processes to handle the load.

The cluster module allows you to easily create child processes that
Expand Down Expand Up @@ -31,9 +31,9 @@ all share server ports.
}).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 23526 online
23521,Master Worker 23523 online
Expand Down Expand Up @@ -74,7 +74,7 @@ out of a total of eight.

Because `server.listen()` hands off most of the work to the master
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,
file descriptor 7 **in the parent** will be listened on, and the
Expand All @@ -91,15 +91,15 @@ node.js process and a cluster worker differs:
want to listen on a unique port, generate a port number based on the
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
program such that it does not rely too heavily on in-memory data objects
for things like sessions and login.

Because workers are all separate processes, they can be killed or
re-spawned depending on your program's needs, without affecting other
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
the worker pool for your application's needs.

Expand All @@ -121,7 +121,7 @@ values are `"rr"` and `"none"`.
## cluster.settings

* {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`)
* `exec` {String} file path to worker file. (Default=`process.argv[1]`)
* `args` {Array} string arguments passed to worker.
Expand Down
6 changes: 3 additions & 3 deletions doc/api/crypto.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ dictionary with keys:
<http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_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
<http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt>.

Expand Down Expand Up @@ -733,12 +733,12 @@ as a temporary measure.

## 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
binary data.

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
changed to use Buffers by default instead.

Expand Down
20 changes: 10 additions & 10 deletions doc/api/debugger.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

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 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:

% node debug myscript.js
% iojs debug myscript.js
< debugger listening on port 5858
connecting... ok
break in /home/indutny/Code/git/indutny/myscript.js:1
Expand All @@ -18,7 +18,7 @@ Node has a built-in client for this debugger. To use this, start Node with the
3 debugger;
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;`
into the source code of your script, you will enable a breakpoint.

Expand All @@ -34,7 +34,7 @@ For example, suppose `myscript.js` looked like this:

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
connecting... ok
break in /home/indutny/Code/git/indutny/myscript.js:1
Expand Down Expand Up @@ -113,7 +113,7 @@ on line 1
It is also possible to set a breakpoint in a file (module) that
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
connecting to port 5858... ok
break in test/fixtures/break-in-module/main.js:1
Expand Down Expand Up @@ -158,13 +158,13 @@ breakpoint)

## Advanced Usage

The V8 debugger can be enabled and accessed either by starting Node with
the `--debug` command-line flag or by signaling an existing Node process
The V8 debugger can be enabled and accessed either by starting io.js with
the `--debug` command-line flag or by signaling an existing io.js process
with `SIGUSR1`.

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:

* `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
* `iojs debug -p <pid>` - Connects to the process via the `pid`
* `iojs debug <URI>` - Connects to the process via the URI such as localhost:5858
2 changes: 1 addition & 1 deletion doc/api/dgram.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
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.

If binding fails, an "error" event is generated. In rare case (e.g.
Expand Down
4 changes: 2 additions & 2 deletions doc/api/dns.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ It's only an operating system facility that can associate name with addresses,
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
of any io.js program. Please take some time to consult the [Implementation
considerations section](#dns_implementation_considerations) before using it.

## dns.lookupService(address, port, callback)
Expand Down Expand Up @@ -275,7 +275,7 @@ were found, then return IPv4 mapped IPv6 addresses.
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),
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

Expand Down
4 changes: 2 additions & 2 deletions doc/api/documentation.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!-- 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
section describes a built-in module or high-level concept.

Expand All @@ -25,7 +25,7 @@ The HTML template is located at `doc/template.html`.
<!--type=misc-->

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
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
Expand Down
2 changes: 1 addition & 1 deletion doc/api/domain.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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,
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
the failure, and react accordingly.

Expand Down
8 changes: 4 additions & 4 deletions doc/api/events.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<!--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
opened. All objects which emit events are instances of `events.EventEmitter`.
You can access this module by doing: `require("events");`
Expand All @@ -23,9 +23,9 @@ attached to.
To access the EventEmitter class, `require('events').EventEmitter`.

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.
If there is no listener for it, then the default action is to print a stack
trace and exit the program.
to emit an `'error'` event. Error events are treated as a special case in
io.js. If there is no listener for it, then the default action is to print
a stack trace and exit the program.

All EventEmitters emit the event `'newListener'` when new listeners are
added and `'removeListener'` when a listener is removed.
Expand Down
Loading

0 comments on commit 789bbb9

Please sign in to comment.