From 789bbb91d3eb30fa2a51e9b064592d6a461a6fe5 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 7 Feb 2015 11:25:13 +0100 Subject: [PATCH] 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 --- doc/api/addons.markdown | 12 ++--- doc/api/buffer.markdown | 8 +-- doc/api/child_process.markdown | 27 +++++----- doc/api/cluster.markdown | 16 +++--- doc/api/crypto.markdown | 6 +-- doc/api/debugger.markdown | 20 +++---- doc/api/dgram.markdown | 2 +- doc/api/dns.markdown | 4 +- doc/api/documentation.markdown | 4 +- doc/api/domain.markdown | 2 +- doc/api/events.markdown | 8 +-- doc/api/fs.markdown | 6 +-- doc/api/globals.markdown | 12 ++--- doc/api/http.markdown | 28 +++++----- doc/api/https.markdown | 2 +- doc/api/modules.markdown | 38 ++++++------- doc/api/net.markdown | 6 +-- doc/api/path.markdown | 8 +-- doc/api/process.markdown | 98 +++++++++++++++++----------------- doc/api/punycode.markdown | 2 +- doc/api/readline.markdown | 8 +-- doc/api/repl.markdown | 22 ++++---- doc/api/stream.markdown | 34 ++++++------ doc/api/synopsis.markdown | 8 +-- doc/api/timers.markdown | 2 +- doc/api/tls.markdown | 8 +-- doc/api/tty.markdown | 12 ++--- doc/api/util.markdown | 4 +- doc/api/v8.markdown | 4 +- doc/api/zlib.markdown | 4 +- 30 files changed, 208 insertions(+), 207 deletions(-) diff --git a/doc/api/addons.markdown b/doc/api/addons.markdown index 0e67ffc5af..bc8fa773ab 100644 --- a/doc/api/addons.markdown +++ b/doc/api/addons.markdown @@ -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). @@ -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. @@ -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 exports); NODE_MODULE(module_name, Initialize) @@ -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 @@ -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: diff --git a/doc/api/buffer.markdown b/doc/api/buffer.markdown index f683618684..e7bbe1980c 100644 --- a/doc/api/buffer.markdown +++ b/doc/api/buffer.markdown @@ -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 @@ -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. @@ -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++) { @@ -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) diff --git a/doc/api/child_process.markdown b/doc/api/child_process.markdown index f4c3380d1c..70bb453e04 100644 --- a/doc/api/child_process.markdown +++ b/doc/api/child_process.markdown @@ -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 @@ -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)`. @@ -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. @@ -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 @@ -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. diff --git a/doc/api/cluster.markdown b/doc/api/cluster.markdown index f65e11c359..11c48cefc0 100644 --- a/doc/api/cluster.markdown +++ b/doc/api/cluster.markdown @@ -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 @@ -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 @@ -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 @@ -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 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. @@ -99,7 +99,7 @@ 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. @@ -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. diff --git a/doc/api/crypto.markdown b/doc/api/crypto.markdown index d862f371a5..5aa9e9beda 100644 --- a/doc/api/crypto.markdown +++ b/doc/api/crypto.markdown @@ -77,7 +77,7 @@ dictionary with keys: 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 . @@ -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. diff --git a/doc/api/debugger.markdown b/doc/api/debugger.markdown index daa582bc20..e20730fa41 100644 --- a/doc/api/debugger.markdown +++ b/doc/api/debugger.markdown @@ -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 @@ -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. @@ -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 @@ -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 @@ -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 ` - Connects to the process via the `pid` -* `node debug ` - Connects to the process via the URI such as localhost:5858 +* `iojs debug -p ` - Connects to the process via the `pid` +* `iojs debug ` - Connects to the process via the URI such as localhost:5858 diff --git a/doc/api/dgram.markdown b/doc/api/dgram.markdown index ce205c0f5c..92bf993d48 100644 --- a/doc/api/dgram.markdown +++ b/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 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. diff --git a/doc/api/dns.markdown b/doc/api/dns.markdown index 6d5583a940..2c28c02b3a 100644 --- a/doc/api/dns.markdown +++ b/doc/api/dns.markdown @@ -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) @@ -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 diff --git a/doc/api/documentation.markdown b/doc/api/documentation.markdown index 6ef71896b1..eccaf75f96 100644 --- a/doc/api/documentation.markdown +++ b/doc/api/documentation.markdown @@ -2,7 +2,7 @@ -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. @@ -25,7 +25,7 @@ The HTML template is located at `doc/template.html`. 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 diff --git a/doc/api/domain.markdown b/doc/api/domain.markdown index 6f9a1a958e..ee66e41563 100644 --- a/doc/api/domain.markdown +++ b/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, 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. diff --git a/doc/api/events.markdown b/doc/api/events.markdown index ffee7d04f3..71704547ad 100644 --- a/doc/api/events.markdown +++ b/doc/api/events.markdown @@ -4,7 +4,7 @@ -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");` @@ -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. diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown index 822b13d7e7..cfb35b96fb 100644 --- a/doc/api/fs.markdown +++ b/doc/api/fs.markdown @@ -72,7 +72,7 @@ site, set the NODE_DEBUG environment variable: } bad(); - $ env NODE_DEBUG=fs node script.js + $ env NODE_DEBUG=fs iojs script.js fs.js:66 throw err; ^ @@ -498,7 +498,7 @@ to `'utf8'`. Example: - fs.writeFile('message.txt', 'Hello Node', function (err) { + fs.writeFile('message.txt', 'Hello io.js', function (err) { if (err) throw err; 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)` 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 on Unix systems, it never was. diff --git a/doc/api/globals.markdown b/doc/api/globals.markdown index 4fb8613382..5b0ed2d3f4 100644 --- a/doc/api/globals.markdown +++ b/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 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 -scope; `var something` inside a Node module will be local to that module. +variable. In io.js this is different. The top-level scope is not the global +scope; `var something` inside an io.js module will be local to that module. ## process @@ -74,9 +74,9 @@ Process files with the extension `.sjs` as `.js`: require.extensions['.sjs'] = require.extensions['.js']; **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 -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. 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 to that module file. -Example: running `node example.js` from `/Users/mjr` +Example: running `iojs example.js` from `/Users/mjr` console.log(__filename); // /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. -Example: running `node example.js` from `/Users/mjr` +Example: running `iojs example.js` from `/Users/mjr` console.log(__dirname); // /Users/mjr diff --git a/doc/api/http.markdown b/doc/api/http.markdown index ec1fdfe496..f5811e4a47 100644 --- a/doc/api/http.markdown +++ b/doc/api/http.markdown @@ -4,7 +4,7 @@ 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. In particular, large, possibly chunk-encoded, messages. The interface is 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. -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 parsing only. It parses a message into headers and body but it does not 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. If the body contains higher coded characters then `Buffer.byteLength()` 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. ### 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 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 first chunk of body. @@ -450,7 +450,7 @@ is finished. ## 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. `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. -* 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. * 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]) -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()` 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 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 require developers to manually close the HTTP clients using 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 options](#http_new_agent_options) below.) Then, the Agent will keep unused sockets in a pool for later use. They will be explicitly -marked so as to not keep the Node 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) KeepAlive agents when they are no longer in use, so that the Sockets 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 '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. 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 srvSocket = net.connect(srvUrl.port, srvUrl.hostname, function() { 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'); srvSocket.write(head); srvSocket.pipe(cltSocket); @@ -863,7 +863,7 @@ the client should send the request body. 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 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 `require('url').parse(request.url)`. Example: - node> require('url').parse('/status?name=ryan') + iojs> require('url').parse('/status?name=ryan') { href: '/status?name=ryan', search: '?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 `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', search: '?name=ryan', query: { name: 'ryan' }, diff --git a/doc/api/https.markdown b/doc/api/https.markdown index 464677e014..2e97e56ab6 100644 --- a/doc/api/https.markdown +++ b/doc/api/https.markdown @@ -2,7 +2,7 @@ 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. ## Class: https.Server diff --git a/doc/api/modules.markdown b/doc/api/modules.markdown index 950d72d891..3cd7175975 100644 --- a/doc/api/modules.markdown +++ b/doc/api/modules.markdown @@ -4,7 +4,7 @@ -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 `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. The output of this program would thus be: - $ node main.js + $ iojs main.js main starting a starting b starting @@ -117,10 +117,10 @@ plan accordingly. -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. -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 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. -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`. `.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 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 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. 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: * `/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 `./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 directory. For example, if there was no package.json file in the above example, then `require('./some-library')` would attempt to load: @@ -425,17 +425,17 @@ in pseudocode of what require.resolve does: 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 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` * 2: `$HOME/.node_libraries` * 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`. These are mostly for historic reasons. You are highly encouraged to @@ -446,13 +446,13 @@ loaded faster, and more reliably. -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 directly by testing 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')`. Because `module` provides a `filename` property (normally equivalent to @@ -463,10 +463,10 @@ by checking `require.main.filename`. -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 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: @@ -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 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 `node_modules` folders as described above, this situation is very simple to 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 than putting packages directly in `/usr/lib/node`, we could put them in -`/usr/lib/node_modules//`. Then node will not bother +`/usr/lib/node_modules//`. Then io.js will not bother 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 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 diff --git a/doc/api/net.markdown b/doc/api/net.markdown index ff204a2ad6..c98a0a8dc5 100644 --- a/doc/api/net.markdown +++ b/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]) @@ -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` 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. ### 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 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 -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 polling on the socket's file descriptor for being writable). diff --git a/doc/api/path.markdown b/doc/api/path.markdown index 3489f1811f..d353559bd8 100644 --- a/doc/api/path.markdown +++ b/doc/api/path.markdown @@ -75,8 +75,8 @@ Examples: '/tmp/file' path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif') - // if currently in /home/myself/node, it returns - '/home/myself/node/wwwroot/static_files/gif/image.gif' + // if currently in /home/myself/iojs, it returns + '/home/myself/iojs/wwwroot/static_files/gif/image.gif' ## path.isAbsolute(path) @@ -196,11 +196,11 @@ An example on *nix: An example on Windows: 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) // returns - ['C:\Windows\system32', 'C:\Windows', 'C:\Program Files\nodejs\'] + ['C:\Windows\system32', 'C:\Windows', 'C:\Program Files\iojs\'] ## path.parse(pathString) diff --git a/doc/api/process.markdown b/doc/api/process.markdown index de24395061..028165de5d 100644 --- a/doc/api/process.markdown +++ b/doc/api/process.markdown @@ -7,7 +7,7 @@ It is an instance of [EventEmitter][]. ## 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 cases: @@ -16,13 +16,13 @@ cases: handler. * `2` - Unused (reserved by Bash for builtin misuse) * `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 - of Node itself. + of io.js itself. * `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 - 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. Typically a message will be printed to stderr with the prefix `FATAL ERROR`. @@ -34,17 +34,17 @@ cases: function itself threw an error while attempting to handle it. This can happen, for example, if a `process.on('uncaughtException')` or `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. * `9` - **Invalid Argument** - Either an unknown option was specified, or an option requiring a value was provided without a value. * `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, - 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` 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 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 @@ -72,9 +72,9 @@ Example of listening for `exit`: ## Event: 'beforeExit' -This event is emitted when node empties it's event loop and has nothing else to -schedule. Normally, node exits when there is no work scheduled, but a listener -for 'beforeExit' can make asynchronous calls, and cause node to continue. +This event is emitted when io.js empties it's event loop and has nothing else to +schedule. Normally, io.js exits when there is no work scheduled, but a listener +for 'beforeExit' can make asynchronous calls, and cause io.js to continue. 'beforeExit' is not emitted for conditions causing explicit termination, such as `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 your application after every unhandled exception! -Do *not* use it as the node.js equivalent of `On Error Resume Next`. An -unhandled exception means your application - and by extension node.js itself - +Do *not* use it as the io.js equivalent of `On Error Resume Next`. An +unhandled exception means your application - and by extension io.js itself - 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. @@ -138,19 +138,19 @@ programs. 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. - `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 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. - `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 - listener installed, however node will be unconditionally terminated by Windows - about 10 seconds later. On non-Windows platforms, the default behaviour of - `SIGHUP` is to terminate node, but once a listener has been installed its - default behaviour will be removed. + listener installed, however io.js will be unconditionally terminated by + Windows about 10 seconds later. On non-Windows platforms, the default + behaviour of `SIGHUP` is to terminate io.js, but once a listener has been + installed its default behaviour will be removed. - `SIGTERM` is not supported on Windows, it can be listened on. - `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 @@ -161,10 +161,10 @@ Note: only happen on write to the console when the cursor is being moved, or when a readable tty is used in raw mode. - `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. -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()`: - 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 @@ -180,7 +180,7 @@ Example: the definition of `console.log` 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` 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 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`: - $ node -p "Boolean(process.stdin.isTTY)" + $ iojs -p "Boolean(process.stdin.isTTY)" true - $ echo "foo" | node -p "Boolean(process.stdin.isTTY)" + $ echo "foo" | iojs -p "Boolean(process.stdin.isTTY)" false - $ node -p "Boolean(process.stdout.isTTY)" + $ iojs -p "Boolean(process.stdout.isTTY)" true - $ node -p "Boolean(process.stdout.isTTY)" | cat + $ iojs -p "Boolean(process.stdout.isTTY)" | cat false 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`). -`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` 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 -with scripts written for node prior v0.10. +with scripts written for node.js prior to v0.10. For more information see [Stream compatibility](stream.html#stream_compatibility_with_older_node_versions). @@ -254,7 +254,7 @@ mode over "old" one. ## process.argv 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. // print process.argv @@ -264,9 +264,9 @@ next elements will be any additional command line arguments. This will generate: - $ node process-2.js one two=three four - 0: node - 1: /Users/mjr/work/node/process-2.js + $ iojs process-2.js one two=three four + 0: iojs + 1: /Users/mjr/work/iojs/process-2.js 2: one 3: two=three 4: four @@ -278,21 +278,21 @@ This is the absolute pathname of the executable that started the process. Example: - /usr/local/bin/node + /usr/local/bin/iojs ## 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 -`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 are useful in order to spawn child processes with the same execution environment as the parent. Example: - $ node --harmony script.js --version + $ iojs --harmony script.js --version results in process.execArgv: @@ -300,12 +300,12 @@ results in process.execArgv: and process.argv: - ['/usr/local/bin/node', 'script.js', '--version'] + ['/usr/local/bin/iojs', 'script.js', '--version'] ## 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. ## process.chdir(directory) @@ -345,12 +345,12 @@ An example of this object looks like: SHLVL: '1', HOME: '/Users/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 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: @@ -367,7 +367,7 @@ To exit with a 'failure' code: 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 @@ -454,7 +454,7 @@ Note: this function is only available on POSIX platforms (i.e. not Windows, Android) 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) @@ -496,7 +496,7 @@ A compiled-in property that exposes `NODE_VERSION`. ## 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); @@ -514,7 +514,7 @@ Will print something like: ## process.config 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. An example of the possible output looks like: @@ -568,7 +568,7 @@ Example of sending a signal to yourself: process.kill(process.pid, 'SIGHUP'); -Note: When SIGUSR1 is received by Node.js it starts the debugger, see +Note: When SIGUSR1 is received by io.js it starts the debugger, see [Signal Events](#process_signal_events). ## process.pid @@ -610,7 +610,7 @@ What platform you're running on: ## 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. var util = require('util'); @@ -717,7 +717,7 @@ given, otherwise returns the current mask. ## process.uptime() -Number of seconds Node has been running. +Number of seconds io.js has been running. ## process.hrtime() diff --git a/doc/api/punycode.markdown b/doc/api/punycode.markdown index e68f0b2671..944870677a 100644 --- a/doc/api/punycode.markdown +++ b/doc/api/punycode.markdown @@ -4,7 +4,7 @@ [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 -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) diff --git a/doc/api/readline.markdown b/doc/api/readline.markdown index 055bc39bdf..f2ae5ea73a 100644 --- a/doc/api/readline.markdown +++ b/doc/api/readline.markdown @@ -5,7 +5,7 @@ To use this module, do `require('readline')`. Readline allows reading of a 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 program to gracefully exit: @@ -16,7 +16,7 @@ program to gracefully exit: 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 console.log("Thank you for your valuable feedback:", answer); @@ -88,8 +88,8 @@ stream. ### rl.setPrompt(prompt) -Sets the prompt, for example when you run `node` on the command line, you see -`> `, which is node's prompt. +Sets the prompt, for example when you run `iojs` on the command line, you see +`> `, which is io.js's prompt. ### rl.prompt([preserveCursor]) diff --git a/doc/api/repl.markdown b/doc/api/repl.markdown index e5081c3c8d..91e20506a9 100644 --- a/doc/api/repl.markdown +++ b/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 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. - mjr:~$ node + mjr:~$ iojs Type '.help' for options. > a = [ 1, 2, 3]; [ 1, 2, 3 ] @@ -21,13 +21,13 @@ dropped into the REPL. It has simplistic emacs line-editing. 2 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 terminal settings which will allow you to use with `rlwrap`. 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) @@ -70,7 +70,7 @@ You can use your own `eval` function if it has following signature: 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. 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; repl.start({ - prompt: "node via stdin> ", + prompt: "io.js via stdin> ", input: process.stdin, 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) { connections += 1; repl.start({ - prompt: "node via Unix socket> ", + prompt: "io.js via Unix socket> ", input: socket, output: socket }).on('exit', function() { socket.end(); }) - }).listen("/tmp/node-repl-sock"); + }).listen("/tmp/iojs-repl-sock"); net.createServer(function (socket) { connections += 1; repl.start({ - prompt: "node via TCP socket> ", + prompt: "io.js via TCP socket> ", input: socket, output: socket }).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. 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 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: - mjr:~$ node repl_test.js + mjr:~$ iojs repl_test.js > m 'message' diff --git a/doc/api/stream.markdown b/doc/api/stream.markdown index bbd2af0d7a..6df99abae9 100644 --- a/doc/api/stream.markdown +++ b/doc/api/stream.markdown @@ -3,7 +3,7 @@ Stability: 2 - Unstable 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 [stdout][]. Streams are readable, writable, or both. All streams are 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 [API for Stream Implementors][] below. -Almost all Node programs, no matter how simple, use Streams in some -way. Here is an example of using Streams in a Node program: +Almost all io.js programs, no matter how simple, use Streams in some +way. Here is an example of using Streams in an io.js program: ```javascript var http = require('http'); @@ -457,17 +457,17 @@ function parseHeader(stream, callback) { * `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 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 `wrap()` method to create a [Readable][] stream that uses the old stream as its data source. 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: @@ -1235,7 +1235,7 @@ simply by using the higher level [Transform][] stream class, similar to the `parseHeader` and `SimpleProtocol v1` examples above. 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. ```javascript @@ -1425,7 +1425,7 @@ stream is not currently reading, then calling `read(0)` will trigger a low-level `_read` call. 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. ### `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('')`. 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 approach, because it almost certainly indicates that something is horribly wrong. -### Compatibility with Older Node Versions +### Compatibility with Older Node.js Versions -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. * 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 even when the stream was in a paused state. -In Node v0.10, the Readable class described below was added. For -backwards compatibility with older Node programs, Readable streams +In io.js v1.0 and Node.js v0.10, the Readable class described below was added. +For backwards compatibility with older Node.js programs, Readable streams switch into "flowing mode" when a `'data'` event handler is added, or when the [`resume()`][] method is called. The effect is that, even if you are not using the new `read()` method and `'readable'` event, you @@ -1491,9 +1491,9 @@ net.createServer(function(socket) { }).listen(1337); ``` -In versions of node prior to v0.10, the incoming message data would be -simply discarded. However, in Node v0.10 and beyond, the socket will -remain paused forever. +In versions of Node.js prior to v0.10, the incoming message data would be +simply discarded. However, in io.js v1.0 and Node.js v0.10 and beyond, +the socket will remain paused forever. The workaround in this situation is to call the `resume()` method to 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 (`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. You should set `objectMode` in your stream child class constructor on diff --git a/doc/api/synopsis.markdown b/doc/api/synopsis.markdown index b3b4608553..10f4f02135 100644 --- a/doc/api/synopsis.markdown +++ b/doc/api/synopsis.markdown @@ -2,8 +2,8 @@ -An example of a [web server](http.html) written with Node which responds with 'Hello -World': +An example of a [web server](http.html) written with io.js which responds with +'Hello World': var http = require('http'); @@ -15,9 +15,9 @@ World': 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 -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/ All of the examples in the documentation can be run similarly. diff --git a/doc/api/timers.markdown b/doc/api/timers.markdown index d05046a50e..c99eadba7c 100644 --- a/doc/api/timers.markdown +++ b/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. 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 be called as close as possible to the time specified. diff --git a/doc/api/tls.markdown b/doc/api/tls.markdown index 1587622a3d..c5cfc1562a 100644 --- a/doc/api/tls.markdown +++ b/doc/api/tls.markdown @@ -148,7 +148,7 @@ automatically set as a listener for the [secureConnection][] event. The on the format. `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 of OpenSSL. Note that it is still possible for a TLS v1.2 client 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 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 . @@ -695,14 +695,14 @@ Example: { C: 'UK', ST: 'Acknack Ltd', L: 'Rhys Jones', - O: 'node.js', + O: 'io.js', OU: 'Test TLS Certificate', CN: 'localhost' }, issuerInfo: { C: 'UK', ST: 'Acknack Ltd', L: 'Rhys Jones', - O: 'node.js', + O: 'io.js', OU: 'Test TLS Certificate', CN: 'localhost' }, issuer: diff --git a/doc/api/tty.markdown b/doc/api/tty.markdown index 36e1f2daa8..bad059cdbb 100644 --- a/doc/api/tty.markdown +++ b/doc/api/tty.markdown @@ -5,14 +5,14 @@ The `tty` module houses the `tty.ReadStream` and `tty.WriteStream` classes. In 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 -a `tty.WriteStream` instance. The preferred way to check if node is being run in -a TTY context is to check `process.stdout.isTTY`: +a `tty.WriteStream` instance. The preferred way to check if io.js is being run +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 - $ node -p -e "Boolean(process.stdout.isTTY)" | cat + $ iojs -p -e "Boolean(process.stdout.isTTY)" | cat false @@ -32,7 +32,7 @@ Deprecated. Use `tty.ReadStream#setRawMode()` 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 -node program (only when `isatty(0)` is true). +io.js program (only when `isatty(0)` is true). ### rs.isRaw diff --git a/doc/api/util.markdown b/doc/api/util.markdown index ac32a29c3e..ad714517b8 100644 --- a/doc/api/util.markdown +++ b/doc/api/util.markdown @@ -5,12 +5,12 @@ These functions are in the module `'util'`. Use `require('util')` to 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 programs. If you find that these functions are lacking for your purposes, however, you are encouraged to write your own utilities. We 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) diff --git a/doc/api/v8.markdown b/doc/api/v8.markdown index 200886ff0d..29f0de8e0d 100644 --- a/doc/api/v8.markdown +++ b/doc/api/v8.markdown @@ -3,7 +3,7 @@ Stability: 1 - Experimental 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. ## 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 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 and their effects is available [here](https://github.com/thlorenz/v8-flags/blob/master/flags-0.11.md). diff --git a/doc/api/zlib.markdown b/doc/api/zlib.markdown index 3ccd2638e1..923f49da1a 100644 --- a/doc/api/zlib.markdown +++ b/doc/api/zlib.markdown @@ -260,7 +260,7 @@ See the description of `deflateInit2` and `inflateInit2` at -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): @@ -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 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 single `write` operation. So, this is another factor that affects the speed, at the cost of memory usage.