Skip to content

Commit

Permalink
Change io.js to node.js in ./doc/
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdeandrade committed Jun 3, 2015
1 parent 1241d79 commit a44056e
Show file tree
Hide file tree
Showing 34 changed files with 954 additions and 223 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 io.js source
`v8.h` header file (`deps/v8/include/v8.h` in the Node.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 io.js libraries. Most importantly is the `node::ObjectWrap`
- Internal Node.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.

io.js statically compiles all its dependencies into the executable.
Node.js statically compiles all its dependencies into the executable.
When compiling your module, you don't need to worry about linking to
any of these libraries.

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

} // namespace demo

Note that all io.js addons must export an initialization function:
Note that all Node.js addons must export an initialization function:

void Initialize(Local<Object> exports);
NODE_MODULE(module_name, Initialize)
Expand Down Expand Up @@ -99,7 +99,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 an io.js project `hello.js` by pointing
You can now use the binary addon in an Node.js project `hello.js` by pointing
`require` to the recently built `hello.node` module:

// hello.js
Expand Down Expand Up @@ -656,7 +656,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 io.js's `node::ObjectWrap::Unwrap` helper function.
by unwrapping them with Node.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. io.js has several strategies for manipulating, creating, and
streams. Node.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 io.js.
will be removed in future versions of Node.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 = "io.js";
str = "Node.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);

// io.js
// Node.js

### buf.equals(otherBuffer)

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

Stability: 2 - Stable

io.js provides a tri-directional `popen(3)` facility through the
Node.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 io.js but it means
line-buffered I/O internally. That doesn't affect Node.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,7 +61,7 @@ of the signal, otherwise `null`.

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

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

Expand Down Expand Up @@ -253,7 +253,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 io.js core.
the `message` event, since they are internal messages used by Node.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 @@ -463,12 +463,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 an io.js program, then
trigger ChildProcess.on('message'). If the child is an Node.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 io.js
3. `'ignore'` - Do not set this file descriptor in the child. Note that Node.js
will always open fd 0 - 2 for the processes it spawns. When any of these is
ignored io.js will open `/dev/null` and attach it to the child's fd.
ignored Node.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 @@ -630,17 +630,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 io.js
This is a special case of the `spawn()` functionality for spawning Node.js
processes. In addition to having all the methods in a normal ChildProcess
instance, the returned object has a communication channel built-in. See
`child.send(message, [sendHandle])` for details.

These child 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
These child Node.js processes are still whole new instances of V8. Assume at
least 30ms startup and 10mb memory for each new Node.js. That is, you cannot
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 `iojs` executable. This should be
created for the child rather than the current `node` 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 - Stable

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
A single instance of Node.js runs in a single thread. To take advantage of
multi-core systems the user will sometimes want to launch a cluster of Node.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 io.js will now share port 8000 between the workers:
Running Node.js will now share port 8000 between the workers:

% NODE_DEBUG=cluster iojs server.js
% NODE_DEBUG=cluster node 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
io.js process and a cluster worker differs:
Node.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 @@ io.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 io.js, or in your program, and no shared
There is no routing logic in Node.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. io.js does not automatically manage the
continue to accept connections. Node.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 io.js executable.
* `execArgv` {Array} list of string arguments passed to the Node.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
4 changes: 2 additions & 2 deletions doc/api/crypto.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,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 io.js will use the default
If no 'ca' details are given, then Node.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 @@ -737,7 +737,7 @@ 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 io.js classes, and many methods accepted and returned
other Node.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).
io.js has a built-in client for this debugger. To use this, start io.js with the
Node.js has a built-in client for this debugger. To use this, start Node.js with the
`debug` argument; a prompt will appear:

% iojs debug myscript.js
% node 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 @@ io.js has a built-in client for this debugger. To use this, start io.js with the
3 debugger;
debug>

io.js's debugger client doesn't support the full range of commands, but
Node.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.

% iojs debug myscript.js
% node 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:

% ./iojs debug test/fixtures/break-in-module/main.js
% ./node 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 io.js with
the `--debug` command-line flag or by signaling an existing io.js process
The V8 debugger can be enabled and accessed either by starting Node.js with
the `--debug` command-line flag or by signaling an existing Node.js process
with `SIGUSR1`.

Once a process has been set in debug mode with this it can be connected to
with the io.js debugger. Either connect to the `pid` or the URI to the debugger.
with the Node.js debugger. Either connect to the `pid` or the URI to the debugger.
The syntax is:

* `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
* `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
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 io.js process running to receive
A bound datagram socket keeps the Node.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 io.js program. Please take some time to consult the [Implementation
of any Node.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 io.js programs.
significant consequences on the behavior of Node.js programs.

### dns.lookup

Expand Down
6 changes: 3 additions & 3 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 io.js
The goal of this documentation is to comprehensively explain the Node.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 @@ -16,7 +16,7 @@ experimental, and added for the benefit of IDEs and other utilities that
wish to do programmatic things with the documentation.

Every `.html` and `.json` file is generated based on the corresponding
`.markdown` file in the `doc/api/` folder in io.js's source tree. The
`.markdown` file in the `doc/api/` folder in Node.js's source tree. The
documentation is generated using the `tools/doc/generate.js` program.
The HTML template is located at `doc/template.html`.

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 io.js API is still somewhat changing, and as it
stability. The Node.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 io.js programs that scale to multiple
encounters an error. For Node.js programs that scale to multiple
machines, the terminating proxy or service registry can take note of
the failure, and react accordingly.

Expand Down
Loading

0 comments on commit a44056e

Please sign in to comment.