From a44056ebd3e46356286b08419b7daa70b843cb59 Mon Sep 17 00:00:00 2001 From: Andrew de Andrade Date: Wed, 3 Jun 2015 15:35:36 -0700 Subject: [PATCH] Change io.js to node.js in ./doc/ --- doc/api/addons.markdown | 12 +- doc/api/buffer.markdown | 8 +- doc/api/child_process.markdown | 22 +- doc/api/cluster.markdown | 16 +- doc/api/crypto.markdown | 4 +- doc/api/debugger.markdown | 20 +- doc/api/dgram.markdown | 2 +- doc/api/dns.markdown | 4 +- doc/api/documentation.markdown | 6 +- doc/api/domain.markdown | 2 +- doc/api/errors.markdown | 24 +- doc/api/events.markdown | 4 +- doc/api/fs.markdown | 4 +- 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 | 92 ++--- doc/api/punycode.markdown | 2 +- doc/api/readline.markdown | 8 +- doc/api/repl.markdown | 26 +- doc/api/stream.markdown | 16 +- doc/api/synopsis.markdown | 6 +- doc/api/timers.markdown | 2 +- doc/api/tls.markdown | 6 +- doc/api/tty.markdown | 10 +- doc/api/util.markdown | 4 +- doc/api/v8.markdown | 6 +- doc/api/zlib.markdown | 4 +- doc/node.1 | 731 +++++++++++++++++++++++++++++++++ doc/releases.md | 34 +- doc/template.html | 8 +- 34 files changed, 954 insertions(+), 223 deletions(-) create mode 100644 doc/node.1 diff --git a/doc/api/addons.markdown b/doc/api/addons.markdown index 1f0562ede..e6df2d93e 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 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). @@ -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. @@ -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 exports); NODE_MODULE(module_name, Initialize) @@ -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 @@ -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: diff --git a/doc/api/buffer.markdown b/doc/api/buffer.markdown index 106097451..17d7c0754 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. 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 @@ -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. @@ -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++) { @@ -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) diff --git a/doc/api/child_process.markdown b/doc/api/child_process.markdown index 19b2b9016..81faed0b0 100644 --- a/doc/api/child_process.markdown +++ b/doc/api/child_process.markdown @@ -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 @@ -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. @@ -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. @@ -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 @@ -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. diff --git a/doc/api/cluster.markdown b/doc/api/cluster.markdown index 6a923b45c..5f720dd68 100644 --- a/doc/api/cluster.markdown +++ b/doc/api/cluster.markdown @@ -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 @@ -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 @@ -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 @@ -91,7 +91,7 @@ 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. @@ -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. 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. @@ -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. diff --git a/doc/api/crypto.markdown b/doc/api/crypto.markdown index 1a181e7e6..41c9a8435 100644 --- a/doc/api/crypto.markdown +++ b/doc/api/crypto.markdown @@ -76,7 +76,7 @@ dictionary with keys: 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 . @@ -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. diff --git a/doc/api/debugger.markdown b/doc/api/debugger.markdown index 9b33eb7d4..d535bfd8e 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). -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 @@ -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. @@ -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 @@ -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 @@ -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 ` - Connects to the process via the `pid` -* `iojs debug ` - Connects to the process via the URI such as localhost:5858 +* `node debug -p ` - Connects to the process via the `pid` +* `node 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 202e907f5..57be799b1 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 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. diff --git a/doc/api/dns.markdown b/doc/api/dns.markdown index a30af870e..f8d9d8239 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 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) @@ -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 diff --git a/doc/api/documentation.markdown b/doc/api/documentation.markdown index 2cb03c8f8..269b844ef 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 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. @@ -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`. @@ -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 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 diff --git a/doc/api/domain.markdown b/doc/api/domain.markdown index 56e8f0650..f2b5d3a55 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 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. diff --git a/doc/api/errors.markdown b/doc/api/errors.markdown index df5f2d74a..6d117931e 100644 --- a/doc/api/errors.markdown +++ b/doc/api/errors.markdown @@ -2,8 +2,8 @@ -Errors generated by io.js fall into two categories: JavaScript errors and system -errors. All errors inherit from or are instances of JavaScript's [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) +Errors generated by Node.js fall into two categories: JavaScript errors and +system errors. All errors inherit from or are instances of JavaScript's [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) class and are guaranteed to provide *at least* the attributes available on that class. @@ -34,7 +34,7 @@ denote any specific circumstance of why the error occurred. Errors capture a "stack trace" detailing the point in the program at which they were instantiated, and may provide a description of the error. -**Note**: io.js will generate this class of error to encapsulate system +**Note**: Node.js will generate this class of error to encapsulate system errors as well as plain JavaScript errors. #### new Error(message) @@ -106,7 +106,7 @@ makeFaster(); // will throw: The location information will be one of: * `native`, if the frame represents a call internal to V8 (as in `[].forEach`). -* `plain-filename.js:line:column`, if the frame represents a call internal to io.js. +* `plain-filename.js:line:column`, if the frame represents a call internal to Node.js. * `/absolute/path/to/file.js:line:column`, if the frame represents a call in a user program, or its dependencies. It is important to note that the string representing the stacktrace is only @@ -177,7 +177,7 @@ range, or outside the set of options for a given function parameter. An example: require('net').connect(-1); // throws RangeError, port should be > 0 && < 65536 ``` -io.js will generate and throw RangeError instances *immediately* -- they are a form +Node.js will generate and throw RangeError instances *immediately* -- they are a form of argument validation. ### Class: TypeError @@ -190,7 +190,7 @@ be considered a TypeError. require('url').parse(function() { }); // throws TypeError, since it expected a string ``` -io.js will generate and throw TypeError instances *immediately* -- they are a form +Node.js will generate and throw TypeError instances *immediately* -- they are a form of argument validation. ### Class: ReferenceError @@ -244,7 +244,7 @@ by other contexts. A JavaScript "exception" is a value that is thrown as a result of an invalid operation or as the target of a `throw` statement. While it is not required that these values inherit from -`Error`, all exceptions thrown by io.js or the JavaScript runtime *will* be instances of Error. +`Error`, all exceptions thrown by Node.js or the JavaScript runtime *will* be instances of Error. Some exceptions are *unrecoverable* at the JavaScript layer. These exceptions will always bring down the process. These are usually failed `assert()` checks or `abort()` calls in the C++ layer. @@ -257,7 +257,7 @@ react to. They are generated at the syscall level: an exhaustive list of error codes and their meanings is available by running `man 2 intro` or `man 3 errno` on most Unices; or [online](http://man7.org/linux/man-pages/man3/errno.3.html). -In io.js, system errors are represented as augmented Error objects -- not full +In Node.js, system errors are represented as augmented Error objects -- not full subclasses, but instead an error instance with added members. ### Class: System Error @@ -275,7 +275,7 @@ letters, and may be referenced in `man 2 intro`. ### Common System Errors This list is **not exhaustive**, but enumerates many of the common system errors when -writing a io.js program. An exhaustive list may be found [here](http://man7.org/linux/man-pages/man3/errno.3.html). +writing a Node.js program. An exhaustive list may be found [here](http://man7.org/linux/man-pages/man3/errno.3.html). #### EPERM: Operation not permitted @@ -315,7 +315,7 @@ at least one has been closed. Commonly encountered when opening many files at once in parallel, especially on systems (in particular, OS X) where there is a low file descriptor limit for processes. To remedy a low limit, run `ulimit -n 2048` in the same shell -that will run the io.js process. +that will run the Node.js process. #### EPIPE: Broken pipe @@ -356,7 +356,7 @@ often a sign that a connected socket was not `.end()`'d appropriately. -All io.js APIs will treat invalid arguments as exceptional -- that is, if passed +All Node.js APIs will treat invalid arguments as exceptional -- that is, if passed invalid arguments, they will *immediately* generate and throw the error as an exception, even if they are an otherwise asynchronous API. @@ -450,7 +450,7 @@ connection.pipe(process.stdout); ``` The "throw when no error handlers are attached behavior" is not limited to APIs -provided by io.js -- even user created event emitters and streams will throw +provided by Node.js -- even user created event emitters and streams will throw errors when no error handlers are attached. An example: ```javascript diff --git a/doc/api/events.markdown b/doc/api/events.markdown index e7470f37a..b34630169 100644 --- a/doc/api/events.markdown +++ b/doc/api/events.markdown @@ -4,7 +4,7 @@ -Many objects in io.js emit events: a `net.Server` emits an event each time +Many objects in Node.js emit events: a `net.Server` emits an event each time a peer connects to it, a `fs.readStream` emits an event when the file is opened. All objects which emit events are instances of `events.EventEmitter`. You can access this module by doing: `require("events");` @@ -28,7 +28,7 @@ var EventEmitter = require('events'); 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 -io.js. If there is no listener for it, then the default action is to print +Node.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 diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown index e3a483e08..398726cea 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 iojs script.js + $ env NODE_DEBUG=fs node script.js fs.js:66 throw err; ^ @@ -499,7 +499,7 @@ to `'utf8'`. Example: - fs.writeFile('message.txt', 'Hello io.js', function (err) { + fs.writeFile('message.txt', 'Hello Node.js', function (err) { if (err) throw err; console.log('It\'s saved!'); }); diff --git a/doc/api/globals.markdown b/doc/api/globals.markdown index 5b0ed2d3f..ab5a59289 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 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. +variable. In Node.js this is different. The top-level scope is not the global +scope; `var something` inside an Node.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 io.js by compiling them on-demand. +non-JavaScript modules into Node.js by compiling them on-demand. However, in practice, there are much better ways to do this, such as -loading modules via some other io.js program, or compiling them to +loading modules via some other Node.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 `iojs example.js` from `/Users/mjr` +Example: running `node example.js` from `/Users/mjr` console.log(__filename); // /Users/mjr/example.js @@ -109,7 +109,7 @@ Example: running `iojs example.js` from `/Users/mjr` The name of the directory that the currently executing script resides in. -Example: running `iojs example.js` from `/Users/mjr` +Example: running `node example.js` from `/Users/mjr` console.log(__dirname); // /Users/mjr diff --git a/doc/api/http.markdown b/doc/api/http.markdown index 245b5d71e..5e79acca9 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 io.js are designed to support many features +The HTTP interfaces in Node.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, io.js's +In order to support the full spectrum of possible HTTP applications, Node.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 io.js does not check whether Content-Length and the length of the body +And Node.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, io.js assumes you're going to be streaming +`response.write()` is called, Node.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]) -io.js maintains several connections per server to make HTTP requests. +Node.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 @@ -537,7 +537,7 @@ on the returned request object. There are a few special headers that should be noted. -* Sending a 'Connection: keep-alive' will notify io.js that the connection to +* Sending a 'Connection: keep-alive' will notify Node.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. @@ -552,7 +552,7 @@ There are a few special headers that should be noted. ## http.get(options[, callback]) -Since most requests are GET requests without bodies, io.js provides this +Since most requests are GET requests without bodies, Node.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. @@ -572,7 +572,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 io.js's +socket to become free the socket is closed. This means that Node.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. @@ -581,7 +581,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 io.js process running. However, it is +marked so as to not keep the Node.js process running. However, it is still a good idea to explicitly [`destroy()`](#http_agent_destroy) KeepAlive agents when they are no longer in use, so that the Sockets will be shut down. @@ -713,7 +713,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: io.js does not check whether Content-Length and the length of the body +Note: Node.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 @@ -762,7 +762,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: io.js-Proxy\r\n' + + 'Proxy-agent: Node.js-Proxy\r\n' + '\r\n'); srvSocket.write(head); srvSocket.pipe(cltSocket); @@ -869,7 +869,7 @@ emitted on the first call to `abort()`. Flush the request headers. -For efficiency reasons, io.js normally buffers the request headers until you +For efficiency reasons, Node.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. @@ -1028,7 +1028,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: - iojs> require('url').parse('/status?name=ryan') + node> require('url').parse('/status?name=ryan') { href: '/status?name=ryan', search: '?name=ryan', query: 'name=ryan', @@ -1038,7 +1038,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: - iojs> require('url').parse('/status?name=ryan', true) + node> 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 4a46760b0..05617e042 100644 --- a/doc/api/https.markdown +++ b/doc/api/https.markdown @@ -2,7 +2,7 @@ Stability: 2 - Stable -HTTPS is the HTTP protocol over TLS/SSL. In io.js this is implemented as a +HTTPS is the HTTP protocol over TLS/SSL. In Node.js this is implemented as a separate module. ## Class: https.Server diff --git a/doc/api/modules.markdown b/doc/api/modules.markdown index 920da7765..65c6bc925 100644 --- a/doc/api/modules.markdown +++ b/doc/api/modules.markdown @@ -4,7 +4,7 @@ -io.js has a simple module loading system. In io.js, files and modules are in +Node.js has a simple module loading system. In Node.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: - $ iojs main.js + $ node main.js main starting a starting b starting @@ -117,10 +117,10 @@ plan accordingly. -io.js has several modules compiled into the binary. These modules are +Node.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 io.js's source in the `lib/` folder. +The core modules are defined in Node.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 io.js will attempt to load the +If the exact filename is not found, then Node.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 io.js starts at the +and does not begin with `'/'`, `'../'`, or `'./'`, then Node.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 io.js would look in the following locations, in +`require('bar.js')`, then Node.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 io.js's awareness of package.json files. +This is the extent of Node.js's awareness of package.json files. -If there is no package.json file present in the directory, then io.js +If there is no package.json file present in the directory, then Node.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 io.js will search those paths for modules if they +of absolute paths, then Node.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, io.js will search in the following locations: +Additionally, Node.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 io.js's +Where `$HOME` is the user's home directory, and `$PREFIX` is Node.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 io.js, `require.main` is set to its +When a file is run directly from Node.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 `iojs foo.js`, but +For a file `foo.js`, this will be `true` if run via `node 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 io.js's `require()` function were designed to be general +The semantics of Node.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 io.js modules without modification. +build native packages from Node.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 io.js looks up the `realpath` of any modules it loads (that is, +Since Node.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 io.js will not bother +`/usr/lib/node_modules//`. Then Node.js will not bother looking for missing dependencies in `/usr/node_modules` or `/node_modules`. -In order to make modules available to the io.js REPL, it might be useful to +In order to make modules available to the Node.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 0c61d4cc9..44b69e703 100644 --- a/doc/api/net.markdown +++ b/doc/api/net.markdown @@ -147,7 +147,7 @@ would be to wait a second and then try again. This can be done with } }); -(Note: All sockets in io.js set `SO_REUSEADDR` already) +(Note: All sockets in Node.js set `SO_REUSEADDR` already) ### server.listen(path[, callback]) @@ -320,7 +320,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 io.js +user and used as a client (with `connect()`) or they can be created by Node.js and passed to the user through the `'connection'` event of a server. ### new net.Socket([options]) @@ -384,7 +384,7 @@ with options either as either `{port: port, host: host}` or `{path: path}`. `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. io.js will internally queue up the data written to a +simply might be too slow. Node.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 08495a79e..0de988fb1 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/iojs, it returns - '/home/myself/iojs/wwwroot/static_files/gif/image.gif' + // if currently in /home/myself/node, it returns + '/home/myself/node/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\iojs\' + // 'C:\Windows\system32;C:\Windows;C:\Program Files\node\' process.env.PATH.split(path.delimiter) // returns - ['C:\\Windows\\system32', 'C:\\Windows', 'C:\\Program Files\\iojs\\'] + ['C:\\Windows\\system32', 'C:\\Windows', 'C:\\Program Files\\node\\'] ## path.parse(pathString) diff --git a/doc/api/process.markdown b/doc/api/process.markdown index ebff3d649..62b6d7bb1 100644 --- a/doc/api/process.markdown +++ b/doc/api/process.markdown @@ -7,7 +7,7 @@ It is an instance of [EventEmitter][]. ## Exit Codes -io.js will normally exit with a `0` status code when no more async +Node.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 io.js's bootstrapping process caused a parse error. This + internal in Node.js's bootstrapping process caused a parse error. This is extremely rare, and generally can only happen during development - of io.js itself. + of Node.js itself. * `4` **Internal JavaScript Evaluation Failure** - The JavaScript - source code internal in io.js's bootstrapping process failed to + source code internal in Node.js's bootstrapping process failed to return a function value when evaluated. This is extremely rare, and - generally can only happen during development of io.js itself. + generally can only happen during development of Node.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 io.js, exit code 8 sometimes +* `8` - Unused. In previous versions of Node.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 io.js's bootstrapping process threw an error + source code internal in Node.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 io.js itself. + and generally can only happen during development of Node.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 io.js receives a fatal signal such as +* `>128` **Signal Exits** - If Node.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 io.js empties its 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. +This event is emitted when Node.js empties its event loop and has nothing else to +schedule. Normally, Node.js exits when there is no work scheduled, but a listener +for 'beforeExit' can make asynchronous calls, and cause Node.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 io.js equivalent of `On Error Resume Next`. An -unhandled exception means your application - and by extension io.js itself - +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 - 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. @@ -200,18 +200,18 @@ programs. Note: -- `SIGUSR1` is reserved by io.js to start the debugger. It's possible to +- `SIGUSR1` is reserved by Node.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 - (io.js will no longer exit). + (Node.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 io.js will be unconditionally terminated by + listener installed, however Node.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 + behaviour of `SIGHUP` is to terminate Node.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 @@ -223,10 +223,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 - io.js on all platforms. + Node.js on all platforms. - `SIGSTOP` cannot have a listener installed. -Note that Windows does not support sending Signals, but io.js offers some +Note that Windows does not support sending Signals, but Node.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 @@ -242,7 +242,7 @@ For example, a `console.log` equivalent could look like this: process.stdout.write(msg + '\n'); }; -`process.stderr` and `process.stdout` are unlike other streams in io.js in +`process.stderr` and `process.stdout` are unlike other streams in Node.js in that they cannot be closed (`end()` will throw), they never emit the `finish` event and that writes are usually blocking. @@ -252,17 +252,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 io.js is being run in a TTY context, read the `isTTY` property +To check if Node.js is being run in a TTY context, read the `isTTY` property on `process.stderr`, `process.stdout`, or `process.stdin`: - $ iojs -p "Boolean(process.stdin.isTTY)" + $ node -p "Boolean(process.stdin.isTTY)" true - $ echo "foo" | iojs -p "Boolean(process.stdin.isTTY)" + $ echo "foo" | node -p "Boolean(process.stdin.isTTY)" false - $ iojs -p "Boolean(process.stdout.isTTY)" + $ node -p "Boolean(process.stdout.isTTY)" true - $ iojs -p "Boolean(process.stdout.isTTY)" | cat + $ node -p "Boolean(process.stdout.isTTY)" | cat false See [the tty docs](tty.html#tty_tty) for more information. @@ -271,7 +271,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 io.js in +`process.stderr` and `process.stdout` are unlike other streams in Node.js in that they cannot be closed (`end()` will throw), they never emit the `finish` event and that writes are usually blocking. @@ -316,7 +316,7 @@ mode over "old" one. ## process.argv An array containing the command line arguments. The first element will be -'iojs', the second element will be the name of the JavaScript file. The +'node', the second element will be the name of the JavaScript file. The next elements will be any additional command line arguments. // print process.argv @@ -326,9 +326,9 @@ next elements will be any additional command line arguments. This will generate: - $ iojs process-2.js one two=three four - 0: iojs - 1: /Users/mjr/work/iojs/process-2.js + $ node process-2.js one two=three four + 0: node + 1: /Users/mjr/work/node/process-2.js 2: one 3: two=three 4: four @@ -340,21 +340,21 @@ This is the absolute pathname of the executable that started the process. Example: - /usr/local/bin/iojs + /usr/local/bin/node ## process.execArgv -This is the set of io.js-specific command line options from the +This is the set of Node.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 io.js executable, the name of +`process.argv`, and do not include the Node.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: - $ iojs --harmony script.js --version + $ node --harmony script.js --version results in process.execArgv: @@ -362,12 +362,12 @@ results in process.execArgv: and process.argv: - ['/usr/local/bin/iojs', 'script.js', '--version'] + ['/usr/local/bin/node', 'script.js', '--version'] ## process.abort() -This causes io.js to emit an abort. This will cause io.js to exit and +This causes Node.js to emit an abort. This will cause Node.js to exit and generate a core file. ## process.chdir(directory) @@ -407,12 +407,12 @@ An example of this object looks like: SHLVL: '1', HOME: '/Users/maciej', LOGNAME: 'maciej', - _: '/usr/local/bin/iojs' } + _: '/usr/local/bin/node' } You can write to this object, but changes won't be reflected outside of your process. That means that the following won't work: - $ iojs -e 'process.env.foo = "bar"' && echo $foo + $ node -e 'process.env.foo = "bar"' && echo $foo But this will: @@ -429,7 +429,7 @@ To exit with a 'failure' code: process.exit(1); -The shell that executed io.js should see the exit code as 1. +The shell that executed Node.js should see the exit code as 1. ## process.exitCode @@ -584,7 +584,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 io.js ensures it always is. +if the effective group ID is included but Node.js ensures it always is. ## process.setgroups(groups) @@ -626,7 +626,7 @@ A compiled-in property that exposes `NODE_VERSION`. ## process.versions -A property exposing version strings of io.js and its dependencies. +A property exposing version strings of Node.js and its dependencies. console.log(process.versions); @@ -644,7 +644,7 @@ Will print something like: ## process.config An Object containing the JavaScript representation of the configure options -that were used to compile the current io.js executable. This is the same as +that were used to compile the current Node.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: @@ -697,7 +697,7 @@ Example of sending a signal to yourself: process.kill(process.pid, 'SIGHUP'); -Note: When SIGUSR1 is received by io.js it starts the debugger, see +Note: When SIGUSR1 is received by Node.js it starts the debugger, see [Signal Events](#process_signal_events). ## process.pid @@ -739,7 +739,7 @@ What platform you're running on: ## process.memoryUsage() -Returns an object describing the memory usage of the io.js process +Returns an object describing the memory usage of the Node.js process measured in bytes. var util = require('util'); @@ -846,7 +846,7 @@ given, otherwise returns the current mask. ## process.uptime() -Number of seconds io.js has been running. +Number of seconds Node.js has been running. ## process.hrtime() diff --git a/doc/api/punycode.markdown b/doc/api/punycode.markdown index f633e3ccd..2f4a9f723 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 io.js versions, use npm to install the `punycode` module first.) +other Node.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 6f9675a11..b556f00c3 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 io.js program will not +Note that once you've invoked this module, your Node.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 io.js? ", function(answer) { + rl.question("What do you think of Node.js? ", function(answer) { // TODO: Log the answer in a database console.log("Thank you for your valuable feedback:", answer); @@ -90,8 +90,8 @@ stream. ### rl.setPrompt(prompt) -Sets the prompt, for example when you run `iojs` on the command line, you see -`> `, which is io.js's prompt. +Sets the prompt, for example when you run `node` on the command line, you see +`> `, which is Node.js's prompt. ### rl.prompt([preserveCursor]) diff --git a/doc/api/repl.markdown b/doc/api/repl.markdown index 18722b902..ce0e480d2 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 `iojs` without any arguments from the command-line you will be +By executing `node` without any arguments from the command-line you will be dropped into the REPL. It has simplistic emacs line-editing. - mjr:~$ iojs + mjr:~$ node Type '.help' for options. > a = [ 1, 2, 3]; [ 1, 2, 3 ] @@ -21,20 +21,20 @@ dropped into the REPL. It has simplistic emacs line-editing. 2 3 -For advanced line-editors, start io.js with the environmental variable +For advanced line-editors, start Node.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 iojs="env NODE_NO_READLINE=1 rlwrap iojs" + alias node="env NODE_NO_READLINE=1 rlwrap node" -The built-in repl (invoked by running `iojs` or `iojs -i`) may be controlled +The built-in repl (invoked by running `node` or `node -i`) may be controlled via the following environment variables: - `NODE_REPL_HISTORY_FILE` - if given, must be a path to a user-writable, user-readable file. When a valid path is given, persistent history support - is enabled: REPL history will persist across `iojs` repl sessions. + is enabled: REPL history will persist across `node` repl sessions. - `NODE_REPL_HISTORY_SIZE` - defaults to `1000`. In conjunction with `NODE_REPL_HISTORY_FILE`, controls how many lines of history will be persisted. Must be a positive number. @@ -90,7 +90,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 io.js. Each +Multiple REPLs may be started against the same running instance of Node.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: @@ -101,7 +101,7 @@ Here is an example that starts a REPL on stdin, a Unix socket, and a TCP socket: connections = 0; repl.start({ - prompt: "io.js via stdin> ", + prompt: "Node.js via stdin> ", input: process.stdin, output: process.stdout }); @@ -109,18 +109,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: "io.js via Unix socket> ", + prompt: "Node.js via Unix socket> ", input: socket, output: socket }).on('exit', function() { socket.end(); }) - }).listen("/tmp/iojs-repl-sock"); + }).listen("/tmp/node-repl-sock"); net.createServer(function (socket) { connections += 1; repl.start({ - prompt: "io.js via TCP socket> ", + prompt: "Node.js via TCP socket> ", input: socket, output: socket }).on('exit', function() { @@ -134,7 +134,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 io.js process without restarting it. +connect to a long-running Node.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 @@ -210,7 +210,7 @@ associated with each `REPLServer`. For example: Things in the `context` object appear as local within the REPL: - mjr:~$ iojs repl_test.js + mjr:~$ node repl_test.js > m 'message' diff --git a/doc/api/stream.markdown b/doc/api/stream.markdown index 12f99078a..f14ac752e 100644 --- a/doc/api/stream.markdown +++ b/doc/api/stream.markdown @@ -3,7 +3,7 @@ Stability: 2 - Stable A stream is an abstract interface implemented by various objects in -io.js. For example a [request to an HTTP +Node.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 io.js programs, no matter how simple, use Streams in some -way. Here is an example of using Streams in an io.js program: +Almost all Node.js programs, no matter how simple, use Streams in some +way. Here is an example of using Streams in an Node.js program: ```javascript var http = require('http'); @@ -461,13 +461,13 @@ 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 io.js library that emits `'data'` events and +If you are using an older Node.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 io.js programs and libraries. +as a convenience for interacting with old Node.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 io.js stream +would be piped into the parser, which is a more idiomatic Node.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 io.js's internals where this is done, particularly in the +cases in Node.js's internals where this is done, particularly in the Readable stream class internals. ### `stream.push('')` @@ -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 io.js core are object mode streams. This pattern is only +No streams in Node.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 10f4f0213..a69273f78 100644 --- a/doc/api/synopsis.markdown +++ b/doc/api/synopsis.markdown @@ -2,7 +2,7 @@ -An example of a [web server](http.html) written with io.js which responds with +An example of a [web server](http.html) written with Node.js which responds with 'Hello World': var http = require('http'); @@ -15,9 +15,9 @@ An example of a [web server](http.html) written with io.js which responds with 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 iojs program +it with the node program - > iojs example.js + > node 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 7df72641c..fd788cd58 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 - io.js makes no guarantees about the exact timing of when +`delay` milliseconds - Node.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 657f69034..791ebe1ad 100644 --- a/doc/api/tls.markdown +++ b/doc/api/tls.markdown @@ -458,7 +458,7 @@ dictionary with keys: instead of the client preferences. For further details see `tls` module documentation. -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 . @@ -709,14 +709,14 @@ Example: { C: 'UK', ST: 'Acknack Ltd', L: 'Rhys Jones', - O: 'io.js', + O: 'Node.js', OU: 'Test TLS Certificate', CN: 'localhost' }, issuerInfo: { C: 'UK', ST: 'Acknack Ltd', L: 'Rhys Jones', - O: 'io.js', + O: 'Node.js', OU: 'Test TLS Certificate', CN: 'localhost' }, issuer: diff --git a/doc/api/tty.markdown b/doc/api/tty.markdown index 60012f306..928d814d9 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 io.js detects that it is being run inside a TTY context, then `process.stdin` +When Node.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 io.js is being run +a `tty.WriteStream` instance. The preferred way to check if Node.js is being run in a TTY context is to check `process.stdout.isTTY`: - $ iojs -p -e "Boolean(process.stdout.isTTY)" + $ node -p -e "Boolean(process.stdout.isTTY)" true - $ iojs -p -e "Boolean(process.stdout.isTTY)" | cat + $ node -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 -io.js program (only when `isatty(0)` is true). +Node.js program (only when `isatty(0)` is true). ### rs.isRaw diff --git a/doc/api/util.markdown b/doc/api/util.markdown index 8ac158269..bc5a5e1a5 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 io.js's +The `util` module is primarily designed to support the needs of Node.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 io.js's internal functionality. +are unnecessary for Node.js's internal functionality. ## util.debuglog(section) diff --git a/doc/api/v8.markdown b/doc/api/v8.markdown index cedd5c86d..3f01ce665 100644 --- a/doc/api/v8.markdown +++ b/doc/api/v8.markdown @@ -3,7 +3,7 @@ Stability: 2 - Stable This module exposes events and interfaces specific to the version of [V8][] -built with io.js. These interfaces are subject to change by upstream and are +built with Node.js. These interfaces are subject to change by upstream and are therefore not covered under the stability index. ## getHeapStatistics() @@ -26,8 +26,8 @@ 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 io.js may be determined by running -`iojs --v8-options`. An unofficial, community-maintained list of options +The V8 options available for a version of Node.js may be determined by running +`node --v8-options`. An unofficial, community-maintained list of options and their effects is available [here](https://github.com/thlorenz/v8-flags/blob/master/flags-0.11.md). diff --git a/doc/api/zlib.markdown b/doc/api/zlib.markdown index a9ceb314e..93a155808 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 io.js's usage: +From `zlib/zconf.h`, modified to Node.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 io.js has to make +In general, greater memory usage options will mean that Node.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. diff --git a/doc/node.1 b/doc/node.1 new file mode 100644 index 000000000..addc2d8c3 --- /dev/null +++ b/doc/node.1 @@ -0,0 +1,731 @@ +.TH NODE.JS "1" "2010" "" "" + + +.SH "NAME" +node \- Server-side JavaScript + +.SH SYNOPSIS + + +.B node +[ +.B \-v +] +[ +.B \-\-debug +| +.B \-\-debug-brk +] +[ +.B \-\-v8-options +] +.br + [ +.B \-e +.I command +| +.I script.js +] +[ +.I arguments +] + +Execute without arguments to start the REPL. + + +.SH DESCRIPTION + +Node.js is a set of libraries for javascript which allows +it to be used outside of the browser. It is primarily +focused on creating simple, easy to build network clients +and servers. + + +.SH OPTIONS + + -v, --version print node's version + + -e, --eval script evaluate script + + -p, --print print result of --eval + + -i, --interactive always enter the REPL even if stdin + does not appear to be a terminal + + -r, --require module to preload at startup + + --no-deprecation silence deprecation warnings + + --trace-deprecation show stack traces on deprecations + + --throw-deprecation throw errors on deprecations + + --v8-options print v8 command line options + + +.SH ENVIRONMENT VARIABLES + +.IP NODE_PATH +\':\'\-separated list of directories prefixed to the module search path. + +.IP NODE_DISABLE_COLORS +If set to 1 then colors will not be used in the REPL. + +.SH V8 OPTIONS + + --use_strict (enforce strict mode) + type: bool default: false + --es_staging (enable all completed harmony features) + type: bool default: false + --harmony (enable all completed harmony features) + type: bool default: false + --harmony_shipping (enable all shipped harmony features) + type: bool default: true + --harmony_modules (enable "harmony modules (implies block scoping)" (in progress)) + type: bool default: false + --harmony_arrays (enable "harmony array methods" (in progress)) + type: bool default: false + --harmony_array_includes (enable "harmony Array.prototype.includes" (in progress)) + type: bool default: false + --harmony_regexps (enable "harmony regular expression extensions" (in progress)) + type: bool default: false + --harmony_arrow_functions (enable "harmony arrow functions" (in progress)) + type: bool default: false + --harmony_proxies (enable "harmony proxies" (in progress)) + type: bool default: false + --harmony_sloppy (enable "harmony features in sloppy mode" (in progress)) + type: bool default: false + --harmony_unicode (enable "harmony unicode escapes" (in progress)) + type: bool default: false + --harmony_tostring (enable "harmony toString") + type: bool default: false + --harmony_numeric_literals (enable "harmony numeric literals") + type: bool default: true + --harmony_strings (enable "harmony string methods") + type: bool default: true + --harmony_scoping (enable "harmony block scoping") + type: bool default: true + --harmony_classes (enable "harmony classes (implies block scoping & object literal extension)") + type: bool default: true + --harmony_object_literals (enable "harmony object literal extensions") + type: bool default: true + --harmony_templates (enable "harmony template literals") + type: bool default: true + --compiled_keyed_generic_loads (use optimizing compiler to generate keyed generic load stubs) + type: bool default: false + --pretenuring_call_new (pretenure call new) + type: bool default: false + --allocation_site_pretenuring (pretenure with allocation sites) + type: bool default: true + --trace_pretenuring (trace pretenuring decisions of HAllocate instructions) + type: bool default: false + --trace_pretenuring_statistics (trace allocation site pretenuring statistics) + type: bool default: false + --track_fields (track fields with only smi values) + type: bool default: true + --track_double_fields (track fields with double values) + type: bool default: true + --track_heap_object_fields (track fields with heap values) + type: bool default: true + --track_computed_fields (track computed boilerplate fields) + type: bool default: true + --track_field_types (track field types) + type: bool default: true + --smi_binop (support smi representation in binary operations) + type: bool default: true + --vector_ics (support vector-based ics) + type: bool default: false + --optimize_for_size (Enables optimizations which favor memory size over execution speed.) + type: bool default: false + --unbox_double_arrays (automatically unbox arrays of doubles) + type: bool default: true + --string_slices (use string slices) + type: bool default: true + --crankshaft (use crankshaft) + type: bool default: true + --hydrogen_filter (optimization filter) + type: string default: * + --use_gvn (use hydrogen global value numbering) + type: bool default: true + --gvn_iterations (maximum number of GVN fix-point iterations) + type: int default: 3 + --use_canonicalizing (use hydrogen instruction canonicalizing) + type: bool default: true + --use_inlining (use function inlining) + type: bool default: true + --use_escape_analysis (use hydrogen escape analysis) + type: bool default: true + --use_allocation_folding (use allocation folding) + type: bool default: true + --use_local_allocation_folding (only fold in basic blocks) + type: bool default: false + --use_write_barrier_elimination (eliminate write barriers targeting allocations in optimized code) + type: bool default: true + --max_inlining_levels (maximum number of inlining levels) + type: int default: 5 + --max_inlined_source_size (maximum source size in bytes considered for a single inlining) + type: int default: 600 + --max_inlined_nodes (maximum number of AST nodes considered for a single inlining) + type: int default: 196 + --max_inlined_nodes_cumulative (maximum cumulative number of AST nodes considered for inlining) + type: int default: 400 + --loop_invariant_code_motion (loop invariant code motion) + type: bool default: true + --fast_math (faster (but maybe less accurate) math functions) + type: bool default: true + --collect_megamorphic_maps_from_stub_cache (crankshaft harvests type feedback from stub cache) + type: bool default: true + --hydrogen_stats (print statistics for hydrogen) + type: bool default: false + --trace_check_elimination (trace check elimination phase) + type: bool default: false + --trace_hydrogen (trace generated hydrogen to file) + type: bool default: false + --trace_hydrogen_filter (hydrogen tracing filter) + type: string default: * + --trace_hydrogen_stubs (trace generated hydrogen for stubs) + type: bool default: false + --trace_hydrogen_file (trace hydrogen to given file name) + type: string default: NULL + --trace_phase (trace generated IR for specified phases) + type: string default: HLZ + --trace_inlining (trace inlining decisions) + type: bool default: false + --trace_load_elimination (trace load elimination) + type: bool default: false + --trace_store_elimination (trace store elimination) + type: bool default: false + --trace_alloc (trace register allocator) + type: bool default: false + --trace_all_uses (trace all use positions) + type: bool default: false + --trace_range (trace range analysis) + type: bool default: false + --trace_gvn (trace global value numbering) + type: bool default: false + --trace_representation (trace representation types) + type: bool default: false + --trace_removable_simulates (trace removable simulates) + type: bool default: false + --trace_escape_analysis (trace hydrogen escape analysis) + type: bool default: false + --trace_allocation_folding (trace allocation folding) + type: bool default: false + --trace_track_allocation_sites (trace the tracking of allocation sites) + type: bool default: false + --trace_migration (trace object migration) + type: bool default: false + --trace_generalization (trace map generalization) + type: bool default: false + --stress_pointer_maps (pointer map for every instruction) + type: bool default: false + --stress_environments (environment for every instruction) + type: bool default: false + --deopt_every_n_times (deoptimize every n times a deopt point is passed) + type: int default: 0 + --deopt_every_n_garbage_collections (deoptimize every n garbage collections) + type: int default: 0 + --print_deopt_stress (print number of possible deopt points) + type: bool default: false + --trap_on_deopt (put a break point before deoptimizing) + type: bool default: false + --trap_on_stub_deopt (put a break point before deoptimizing a stub) + type: bool default: false + --deoptimize_uncommon_cases (deoptimize uncommon cases) + type: bool default: true + --polymorphic_inlining (polymorphic inlining) + type: bool default: true + --use_osr (use on-stack replacement) + type: bool default: true + --array_bounds_checks_elimination (perform array bounds checks elimination) + type: bool default: true + --trace_bce (trace array bounds check elimination) + type: bool default: false + --array_bounds_checks_hoisting (perform array bounds checks hoisting) + type: bool default: false + --array_index_dehoisting (perform array index dehoisting) + type: bool default: true + --analyze_environment_liveness (analyze liveness of environment slots and zap dead values) + type: bool default: true + --load_elimination (use load elimination) + type: bool default: true + --check_elimination (use check elimination) + type: bool default: true + --store_elimination (use store elimination) + type: bool default: false + --dead_code_elimination (use dead code elimination) + type: bool default: true + --fold_constants (use constant folding) + type: bool default: true + --trace_dead_code_elimination (trace dead code elimination) + type: bool default: false + --unreachable_code_elimination (eliminate unreachable code) + type: bool default: true + --trace_osr (trace on-stack replacement) + type: bool default: false + --stress_runs (number of stress runs) + type: int default: 0 + --lookup_sample_by_shared (when picking a function to optimize, watch for shared function info, not JSFunction itself) + type: bool default: true + --cache_optimized_code (cache optimized code for closures) + type: bool default: true + --flush_optimized_code_cache (flushes the cache of optimized code for closures on every GC) + type: bool default: true + --inline_construct (inline constructor calls) + type: bool default: true + --inline_arguments (inline functions with arguments object) + type: bool default: true + --inline_accessors (inline JavaScript accessors) + type: bool default: true + --escape_analysis_iterations (maximum number of escape analysis fix-point iterations) + type: int default: 2 + --optimize_for_in (optimize functions containing for-in loops) + type: bool default: true + --concurrent_recompilation (optimizing hot functions asynchronously on a separate thread) + type: bool default: true + --job_based_recompilation (post tasks to v8::Platform instead of using a thread for concurrent recompilation) + type: bool default: false + --trace_concurrent_recompilation (track concurrent recompilation) + type: bool default: false + --concurrent_recompilation_queue_length (the length of the concurrent compilation queue) + type: int default: 8 + --concurrent_recompilation_delay (artificial compilation delay in ms) + type: int default: 0 + --block_concurrent_recompilation (block queued jobs until released) + type: bool default: false + --concurrent_osr (concurrent on-stack replacement) + type: bool default: true + --omit_map_checks_for_leaf_maps (do not emit check maps for constant values that have a leaf map, deoptimize the optimized code if the layout of the maps changes.) + type: bool default: true + --turbo_filter (optimization filter for TurboFan compiler) + type: string default: ~ + --trace_turbo (trace generated TurboFan IR) + type: bool default: false + --trace_turbo_graph (trace generated TurboFan graphs) + type: bool default: false + --trace_turbo_cfg_file (trace turbo cfg graph (for C1 visualizer) to a given file name) + type: string default: NULL + --trace_turbo_types (trace TurboFan's types) + type: bool default: true + --trace_turbo_scheduler (trace TurboFan's scheduler) + type: bool default: false + --trace_turbo_reduction (trace TurboFan's various reducers) + type: bool default: false + --trace_turbo_jt (trace TurboFan's jump threading) + type: bool default: false + --turbo_asm (enable TurboFan for asm.js code) + type: bool default: true + --turbo_verify (verify TurboFan graphs at each phase) + type: bool default: false + --turbo_stats (print TurboFan statistics) + type: bool default: false + --turbo_types (use typed lowering in TurboFan) + type: bool default: true + --turbo_source_positions (track source code positions when building TurboFan IR) + type: bool default: false + --context_specialization (enable context specialization in TurboFan) + type: bool default: false + --turbo_deoptimization (enable deoptimization in TurboFan) + type: bool default: false + --turbo_inlining (enable inlining in TurboFan) + type: bool default: false + --turbo_inlining_intrinsics (enable inlining of intrinsics in TurboFan) + type: bool default: false + --trace_turbo_inlining (trace TurboFan inlining) + type: bool default: false + --loop_assignment_analysis (perform loop assignment analysis) + type: bool default: true + --turbo_profiling (enable profiling in TurboFan) + type: bool default: false + --turbo_reuse_spill_slots (reuse spill slots in TurboFan) + type: bool default: true + --turbo_delay_ssa_decon (delay ssa deconstruction in TurboFan register allocator) + type: bool default: false + --turbo_move_optimization (optimize gap moves in TurboFan) + type: bool default: true + --turbo_jt (enable jump threading) + type: bool default: true + --typed_array_max_size_in_heap (threshold for in-heap typed array) + type: int default: 64 + --frame_count (number of stack frames inspected by the profiler) + type: int default: 1 + --interrupt_budget (execution budget before interrupt is triggered) + type: int default: 6144 + --type_info_threshold (percentage of ICs that must have type info to allow optimization) + type: int default: 25 + --generic_ic_threshold (max percentage of megamorphic/generic ICs to allow optimization) + type: int default: 30 + --self_opt_count (call count before self-optimization) + type: int default: 130 + --trace_opt_verbose (extra verbose compilation tracing) + type: bool default: false + --debug_code (generate extra code (assertions) for debugging) + type: bool default: false + --code_comments (emit comments in code disassembly) + type: bool default: false + --enable_sse3 (enable use of SSE3 instructions if available) + type: bool default: true + --enable_sse4_1 (enable use of SSE4.1 instructions if available) + type: bool default: true + --enable_sahf (enable use of SAHF instruction if available (X64 only)) + type: bool default: true + --enable_avx (enable use of AVX instructions if available) + type: bool default: true + --enable_fma3 (enable use of FMA3 instructions if available) + type: bool default: true + --enable_vfp3 (enable use of VFP3 instructions if available) + type: bool default: true + --enable_armv7 (enable use of ARMv7 instructions if available (ARM only)) + type: bool default: true + --enable_armv8 (enable use of ARMv8 instructions if available (ARM 32-bit only)) + type: bool default: true + --enable_neon (enable use of NEON instructions if available (ARM only)) + type: bool default: true + --enable_sudiv (enable use of SDIV and UDIV instructions if available (ARM only)) + type: bool default: true + --enable_mls (enable use of MLS instructions if available (ARM only)) + type: bool default: true + --enable_movw_movt (enable loading 32-bit constant by means of movw/movt instruction pairs (ARM only)) + type: bool default: false + --enable_unaligned_accesses (enable unaligned accesses for ARMv7 (ARM only)) + type: bool default: true + --enable_32dregs (enable use of d16-d31 registers on ARM - this requires VFP3) + type: bool default: true + --enable_vldr_imm (enable use of constant pools for double immediate (ARM only)) + type: bool default: false + --force_long_branches (force all emitted branches to be in long mode (MIPS only)) + type: bool default: false + --expose_natives_as (expose natives in global object) + type: string default: NULL + --expose_debug_as (expose debug in global object) + type: string default: NULL + --expose_free_buffer (expose freeBuffer extension) + type: bool default: false + --expose_gc (expose gc extension) + type: bool default: false + --expose_gc_as (expose gc extension under the specified name) + type: string default: NULL + --expose_externalize_string (expose externalize string extension) + type: bool default: false + --expose_trigger_failure (expose trigger-failure extension) + type: bool default: false + --stack_trace_limit (number of stack frames to capture) + type: int default: 10 + --builtins_in_stack_traces (show built-in functions in stack traces) + type: bool default: false + --disable_native_files (disable builtin natives files) + type: bool default: false + --inline_new (use fast inline allocation) + type: bool default: true + --trace_codegen (print name of functions for which code is generated) + type: bool default: false + --trace (trace function calls) + type: bool default: false + --mask_constants_with_cookie (use random jit cookie to mask large constants) + type: bool default: true + --lazy (use lazy compilation) + type: bool default: true + --trace_opt (trace lazy optimization) + type: bool default: false + --trace_opt_stats (trace lazy optimization statistics) + type: bool default: false + --opt (use adaptive optimizations) + type: bool default: true + --always_opt (always try to optimize functions) + type: bool default: false + --always_osr (always try to OSR functions) + type: bool default: false + --prepare_always_opt (prepare for turning on always opt) + type: bool default: false + --trace_deopt (trace optimize function deoptimization) + type: bool default: false + --trace_stub_failures (trace deoptimization of generated code stubs) + type: bool default: false + --serialize_toplevel (enable caching of toplevel scripts) + type: bool default: true + --serialize_inner (enable caching of inner functions) + type: bool default: false + --trace_serializer (print code serializer trace) + type: bool default: false + --min_preparse_length (minimum length for automatic enable preparsing) + type: int default: 1024 + --max_opt_count (maximum number of optimization attempts before giving up.) + type: int default: 10 + --compilation_cache (enable compilation cache) + type: bool default: true + --cache_prototype_transitions (cache prototype transitions) + type: bool default: true + --cpu_profiler_sampling_interval (CPU profiler sampling interval in microseconds) + type: int default: 1000 + --trace_debug_json (trace debugging JSON request/response) + type: bool default: false + --trace_js_array_abuse (trace out-of-bounds accesses to JS arrays) + type: bool default: false + --trace_external_array_abuse (trace out-of-bounds-accesses to external arrays) + type: bool default: false + --trace_array_abuse (trace out-of-bounds accesses to all arrays) + type: bool default: false + --enable_liveedit (enable liveedit experimental feature) + type: bool default: true + --hard_abort (abort by crashing) + type: bool default: true + --stack_size (default size of stack region v8 is allowed to use (in kBytes)) + type: int default: 984 + --max_stack_trace_source_length (maximum length of function source code printed in a stack trace.) + type: int default: 300 + --always_inline_smi_code (always inline smi code in non-opt code) + type: bool default: false + --min_semi_space_size (min size of a semi-space (in MBytes), the new space consists of twosemi-spaces) + type: int default: 0 + --target_semi_space_size (target size of a semi-space (in MBytes) before triggering a GC) + type: int default: 0 + --max_semi_space_size (max size of a semi-space (in MBytes), the new space consists of twosemi-spaces) + type: int default: 0 + --semi_space_growth_factor (factor by which to grow the new space) + type: int default: 2 + --experimental_new_space_growth_heuristic (Grow the new space based on the percentage of survivors instead of their absolute value.) + type: bool default: false + --max_old_space_size (max size of the old space (in Mbytes)) + type: int default: 0 + --initial_old_space_size (initial old space size (in Mbytes)) + type: int default: 0 + --max_executable_size (max size of executable memory (in Mbytes)) + type: int default: 0 + --gc_global (always perform global GCs) + type: bool default: false + --gc_interval (garbage collect after allocations) + type: int default: -1 + --trace_gc (print one trace line following each garbage collection) + type: bool default: false + --trace_gc_nvp (print one detailed trace line in name=value format after each garbage collection) + type: bool default: false + --trace_gc_ignore_scavenger (do not print trace line after scavenger collection) + type: bool default: false + --trace_idle_notification (print one trace line following each idle notification) + type: bool default: false + --trace_idle_notification_verbose (prints the heap state used by the idle notification) + type: bool default: false + --print_cumulative_gc_stat (print cumulative GC statistics in name=value format on exit) + type: bool default: false + --print_max_heap_committed (print statistics of the maximum memory committed for the heap in name=value format on exit) + type: bool default: false + --trace_gc_verbose (print more details following each garbage collection) + type: bool default: false + --trace_fragmentation (report fragmentation for old pointer and data pages) + type: bool default: false + --collect_maps (garbage collect maps from which no objects can be reached) + type: bool default: true + --weak_embedded_maps_in_optimized_code (make maps embedded in optimized code weak) + type: bool default: true + --weak_embedded_objects_in_optimized_code (make objects embedded in optimized code weak) + type: bool default: true + --flush_code (flush code that we expect not to use again (during full gc)) + type: bool default: true + --flush_code_incrementally (flush code that we expect not to use again (incrementally)) + type: bool default: true + --trace_code_flushing (trace code flushing progress) + type: bool default: false + --age_code (track un-executed functions to age code and flush only old code (required for code flushing)) + type: bool default: true + --incremental_marking (use incremental marking) + type: bool default: true + --incremental_marking_steps (do incremental marking steps) + type: bool default: true + --concurrent_sweeping (use concurrent sweeping) + type: bool default: true + --trace_incremental_marking (trace progress of the incremental marking) + type: bool default: false + --track_gc_object_stats (track object counts and memory usage) + type: bool default: false + --heap_profiler_trace_objects (Dump heap object allocations/movements/size_updates) + type: bool default: false + --use_idle_notification (Use idle notification to reduce memory footprint.) + type: bool default: true + --use_ic (use inline caching) + type: bool default: true + --trace_ic (trace inline cache state transitions) + type: bool default: false + --native_code_counters (generate extra code for manipulating stats counters) + type: bool default: false + --always_compact (Perform compaction on every full GC) + type: bool default: false + --never_compact (Never perform compaction on full GC - testing only) + type: bool default: false + --compact_code_space (Compact code space on full non-incremental collections) + type: bool default: true + --incremental_code_compaction (Compact code space on full incremental collections) + type: bool default: true + --cleanup_code_caches_at_gc (Flush inline caches prior to mark compact collection and flush code caches in maps during mark compact cycle.) + type: bool default: true + --use_marking_progress_bar (Use a progress bar to scan large objects in increments when incremental marking is active.) + type: bool default: true + --zap_code_space (Zap free memory in code space with 0xCC while sweeping.) + type: bool default: true + --random_seed (Default seed for initializing random generator (0, the default, means to use system random).) + type: int default: 0 + --trace_weak_arrays (trace WeakFixedArray usage) + type: bool default: false + --track_prototype_users (keep track of which maps refer to a given prototype object) + type: bool default: false + --use_verbose_printer (allows verbose printing) + type: bool default: true + --allow_natives_syntax (allow natives syntax) + type: bool default: false + --trace_parse (trace parsing and preparsing) + type: bool default: false + --trace_sim (Trace simulator execution) + type: bool default: false + --debug_sim (Enable debugging the simulator) + type: bool default: false + --check_icache (Check icache flushes in ARM and MIPS simulator) + type: bool default: false + --stop_sim_at (Simulator stop after x number of instructions) + type: int default: 0 + --sim_stack_alignment (Stack alingment in bytes in simulator (4 or 8, 8 is default)) + type: int default: 8 + --sim_stack_size (Stack size of the ARM64 and MIPS64 simulator in kBytes (default is 2 MB)) + type: int default: 2048 + --log_regs_modified (When logging register values, only print modified registers.) + type: bool default: true + --log_colour (When logging, try to use coloured output.) + type: bool default: true + --ignore_asm_unimplemented_break (Don't break for ASM_UNIMPLEMENTED_BREAK macros.) + type: bool default: false + --trace_sim_messages (Trace simulator debug messages. Implied by --trace-sim.) + type: bool default: false + --stack_trace_on_illegal (print stack trace when an illegal exception is thrown) + type: bool default: false + --abort_on_uncaught_exception (abort program (dump core) when an uncaught exception is thrown) + type: bool default: false + --randomize_hashes (randomize hashes to avoid predictable hash collisions (with snapshots this option cannot override the baked-in seed)) + type: bool default: true + --hash_seed (Fixed seed to use to hash property keys (0 means random)(with snapshots this option cannot override the baked-in seed)) + type: int default: 0 + --profile_deserialization (Print the time it takes to deserialize the snapshot.) + type: bool default: false + --regexp_optimization (generate optimized regexp code) + type: bool default: true + --testing_bool_flag (testing_bool_flag) + type: bool default: true + --testing_maybe_bool_flag (testing_maybe_bool_flag) + type: maybe_bool default: unset + --testing_int_flag (testing_int_flag) + type: int default: 13 + --testing_float_flag (float-flag) + type: float default: 2.5 + --testing_string_flag (string-flag) + type: string default: Hello, world! + --testing_prng_seed (Seed used for threading test randomness) + type: int default: 42 + --testing_serialization_file (file in which to serialize heap) + type: string default: /tmp/serdes + --startup_blob (Write V8 startup blob file. (mksnapshot only)) + type: string default: NULL + --profile_hydrogen_code_stub_compilation (Print the time it takes to lazily compile hydrogen code stubs.) + type: bool default: false + --predictable (enable predictable mode) + type: bool default: false + --help (Print usage message, including flags, on console) + type: bool default: true + --dump_counters (Dump counters on exit) + type: bool default: false + --debugger (Enable JavaScript debugger) + type: bool default: false + --map_counters (Map counters to a file) + type: string default: + --js_arguments (Pass all remaining arguments to the script. Alias for "--".) + type: arguments default: + --gdbjit (enable GDBJIT interface (disables compacting GC)) + type: bool default: false + --gdbjit_full (enable GDBJIT interface for all code objects) + type: bool default: false + --gdbjit_dump (dump elf objects with debug info to disk) + type: bool default: false + --gdbjit_dump_filter (dump only objects containing this substring) + type: string default: + --force_marking_deque_overflows (force overflows of marking deque by reducing it's size to 64 words) + type: bool default: false + --stress_compaction (stress the GC compactor to flush out bugs (implies --force_marking_deque_overflows)) + type: bool default: false + --log (Minimal logging (no API, code, GC, suspect, or handles samples).) + type: bool default: false + --log_all (Log all events to the log file.) + type: bool default: false + --log_api (Log API events to the log file.) + type: bool default: false + --log_code (Log code events to the log file without profiling.) + type: bool default: false + --log_gc (Log heap samples on garbage collection for the hp2ps tool.) + type: bool default: false + --log_handles (Log global handle events.) + type: bool default: false + --log_snapshot_positions (log positions of (de)serialized objects in the snapshot.) + type: bool default: false + --log_suspect (Log suspect operations.) + type: bool default: false + --prof (Log statistical profiling information (implies --log-code).) + type: bool default: false + --prof_browser_mode (Used with --prof, turns on browser-compatible mode for profiling.) + type: bool default: true + --log_regexp (Log regular expression execution.) + type: bool default: false + --logfile (Specify the name of the log file.) + type: string default: v8.log + --logfile_per_isolate (Separate log files for each isolate.) + type: bool default: true + --ll_prof (Enable low-level linux profiler.) + type: bool default: false + --perf_basic_prof (Enable perf linux profiler (basic support).) + type: bool default: false + --perf_jit_prof (Enable perf linux profiler (experimental annotate support).) + type: bool default: false + --gc_fake_mmap (Specify the name of the file for fake gc mmap used in ll_prof) + type: string default: /tmp/__v8_gc__ + --log_internal_timer_events (Time internal events.) + type: bool default: false + --log_timer_events (Time events including external callbacks.) + type: bool default: false + --log_instruction_stats (Log AArch64 instruction statistics.) + type: bool default: false + --log_instruction_file (AArch64 instruction statistics log file.) + type: string default: arm64_inst.csv + --log_instruction_period (AArch64 instruction statistics logging period.) + type: int default: 4194304 + --redirect_code_traces (output deopt information and disassembly into file code--.asm) + type: bool default: false + --redirect_code_traces_to (output deopt information and disassembly into the given file) + type: string default: NULL + --hydrogen_track_positions (track source code positions when building IR) + type: bool default: false + --trace_elements_transitions (trace elements transitions) + type: bool default: false + --trace_creation_allocation_sites (trace the creation of allocation sites) + type: bool default: false + --print_code_stubs (print code stubs) + type: bool default: false + --test_secondary_stub_cache (test secondary stub cache by disabling the primary one) + type: bool default: false + --test_primary_stub_cache (test primary stub cache by disabling the secondary one) + type: bool default: false + --print_code (print generated code) + type: bool default: false + --print_opt_code (print optimized code) + type: bool default: false + --print_unopt_code (print unoptimized code before printing optimized code based on it) + type: bool default: false + --print_code_verbose (print more information for code) + type: bool default: false + --print_builtin_code (print generated code for builtins) + type: bool default: false + --sodium (print generated code output suitable for use with the Sodium code viewer) + type: bool default: false + --print_all_code (enable all flags related to printing code) + type: bool default: false + +.SH RESOURCES AND DOCUMENTATION + +See the website for documentation http://nodejs.org/ + +Mailing list: http://groups.google.com/group/nodejs + +IRC: irc.freenode.net #node.js diff --git a/doc/releases.md b/doc/releases.md index abcf97849..7b4f77f5f 100644 --- a/doc/releases.md +++ b/doc/releases.md @@ -1,33 +1,33 @@ -io.js Release Process +Node.js Release Process ===================== -This document describes the technical aspects of the io.js release process. The intended audience is those who have been authorized by the Technical Committee (TC) to create, promote and sign official release builds for io.js, hosted on . +This document describes the technical aspects of the Node.js release process. The intended audience is those who have been authorized by the Technical Committee (TC) to create, promote and sign official release builds for Node.js, hosted on . ## Who can make a release? -Release authorization is given by the io.js TC. Once authorized, an individual must be have the following: +Release authorization is given by the Node.js TC. Once authorized, an individual must be have the following: ### 1. Jenkins Release Access There are three relevant Jenkins jobs that should be used for a release flow: -**a.** **[iojs+any-pr+multi](https://jenkins-iojs.nodesource.com/job/iojs+any-pr+multi/)** is used for a final full-test run to ensure that the current *HEAD* is stable. +**a.** **[node+any-pr+multi](https://jenkins-iojs.nodesource.com/job/iojs+any-pr+multi/)** is used for a final full-test run to ensure that the current *HEAD* is stable. -**b.** (optional) **[iojs+release+nightly](https://jenkins-iojs.nodesource.com/job/iojs+release+nightly/)** can be used to create a nightly release for the current *HEAD* if public test releases are required. Builds triggered with this job are published straight to and are available for public download. +**b.** (optional) **[node+release+nightly](https://jenkins-iojs.nodesource.com/job/iojs+release+nightly/)** can be used to create a nightly release for the current *HEAD* if public test releases are required. Builds triggered with this job are published straight to and are available for public download. -**c.** **[iojs+release](https://jenkins-iojs.nodesource.com/job/iojs+release/)** does all of the work to build all required release assets. Promotion of the release files is a manual step once they are ready (see below). +**c.** **[node+release](https://jenkins-iojs.nodesource.com/job/iojs+release/)** does all of the work to build all required release assets. Promotion of the release files is a manual step once they are ready (see below). -The [io.js build team](https://github.com/iojs/build) is able to provide this access to individuals authorized by the TC. +The [Node.js build team](https://github.com/nodejs/build) is able to provide this access to individuals authorized by the TC. -### 2. Access +### 2. Access -The _dist_ user on iojs.org controls the assets available in (note that is an alias for ). +The _dist_ user on nodejs.org controls the assets available in (note that is an alias for ). The Jenkins release build slaves upload their artefacts to the web server as the _staging_ user, the _dist_ user has access to move these assets to public access (the _staging_ user does not, for security purposes). Nightly builds are promoted automatically on the server by a cron task for the _dist_ user. -Release builds require manual promotion by an individual with SSH access to the server as the _dist_ user. The [io.js build team](https://github.com/iojs/build) is able to provide this access to individuals authorized by the TC. +Release builds require manual promotion by an individual with SSH access to the server as the _dist_ user. The [Node.js build team](https://github.com/nodejs/build) is able to provide this access to individuals authorized by the TC. ### 3. A Publicly Listed GPG Key @@ -39,7 +39,7 @@ The GPG keys should be fetchable from a known third-party keyserver, currently t gpg --keyserver pool.sks-keyservers.net --recv-keys ``` -Additionally, full GPG key fingerprints for individuals authorized to release should be listed in the io.js GitHub README.md file. +Additionally, full GPG key fingerprints for individuals authorized to release should be listed in the Node.js GitHub README.md file. ## How to create a release @@ -50,11 +50,11 @@ Notes: ### 1. Ensure that HEAD Is Stable -Run a **[iojs+any-pr+multi](https://jenkins-iojs.nodesource.com/job/iojs+any-pr+multi/)** test run to ensure that the build is stable and the HEAD commit is ready for release. +Run a **[node+any-pr+multi](https://jenkins-iojs.nodesource.com/job/iojs+any-pr+multi/)** test run to ensure that the build is stable and the HEAD commit is ready for release. ### 2. Produce a Nightly Build _(optional)_ -If there is reason to produce a test release for the purpose of having others try out installers or specifics of builds, produce a nightly build using **[iojs+release+nightly](https://jenkins-iojs.nodesource.com/job/iojs+release+nightly/)** and wait for it to drop in . +If there is reason to produce a test release for the purpose of having others try out installers or specifics of builds, produce a nightly build using **[node+release+nightly](https://jenkins-iojs.nodesource.com/job/iojs+release+nightly/)** and wait for it to drop in . This is particularly recommended if there has been recent work relating to the OS X or Windows installers as they are not tested in any way by CI. @@ -123,7 +123,7 @@ The _CHANGELOG.md_ and _src/node_version.h_ changes should be the final commit t When committing these to git, use the following message format: ``` -YYYY-MM-DD io.js vx.y.z Release +YYYY-MM-DD Node.js vx.y.z Release Notable changes: @@ -135,7 +135,7 @@ Notable changes: Tag the release as vx.y.z and sign **using the same GPG key that will be used to sign SHASUMS256.txt**. ``` -git tag -sm 'YYYY-MM-DD io.js vz.y.x Release' vx.y.z +git tag -sm 'YYYY-MM-DD Node.js vz.y.x Release' vx.y.z ``` ### 8. Set Up For the Next Release @@ -164,7 +164,7 @@ git push origin branch vx.y.z ### 9. Produce Release Builds -Use **[iojs+release](https://jenkins-iojs.nodesource.com/job/iojs+release/)** to produce release artefacts. Enter the "vx.y.z" version string for this release and it will fetch your tagged commit. +Use **[node+release](https://jenkins-iojs.nodesource.com/job/iojs+release/)** to produce release artefacts. Enter the "vx.y.z" version string for this release and it will fetch your tagged commit. Artefacts from each slave are uploaded to Jenkins and are available if further testing is required. Use this opportunity particularly to test OS X and Windows installers if there are any concerns. Click through to the individual slaves for a run to find the artefacts. For example, the Windows 64-bit .msi file for v1.0.4 can be found [here](https://jenkins-iojs.nodesource.com/job/iojs+release/20/nodes=iojs-win2008r2-release-x64/). @@ -198,7 +198,7 @@ If you didn't wait for ARM builds in the previous step before promoting the rele ### 11. Check the Release -Your release should be available at and also . Check that the appropriate files are in place, you may also want to check that the binaries are working as appropriate and have the right internal version strings. Check that the API docs are available at . Check that the release catalog files are correct at and . +Your release should be available at and also . Check that the appropriate files are in place, you may also want to check that the binaries are working as appropriate and have the right internal version strings. Check that the API docs are available at . Check that the release catalog files are correct at and . ### 12. Announce diff --git a/doc/template.html b/doc/template.html index 7d32a5b59..f9f27d0dc 100644 --- a/doc/template.html +++ b/doc/template.html @@ -2,18 +2,18 @@ - __SECTION__ io.js __VERSION__ Manual & Documentation + __SECTION__ Node.js __VERSION__ Manual & Documentation - +
__GTOC__ @@ -21,7 +21,7 @@
-

io.js __VERSION__ Documentation

+

Node.js __VERSION__ Documentation

Index |