From 65f2cdda2a7aad7f8ca45e9490a635d25993773b Mon Sep 17 00:00:00 2001 From: Grant Heaslip Date: Tue, 5 Jul 2011 22:43:43 -0400 Subject: [PATCH] Clean up process object descriptions --- book.html | 28 ++++++++++++++-------------- chapters/globals.html | 28 ++++++++++++++-------------- chapters/globals.md | 28 ++++++++++++++-------------- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/book.html b/book.html index 4e7866b..a67ed2e 100644 --- a/book.html +++ b/book.html @@ -349,24 +349,24 @@

console.assert()

process

-

The process object is plastered with goodies, first we will take a look -at some properties that provide information about the node process itself.

+

The process object is plastered with goodies. First we will take a look +at some properties that provide information about the node process itself:

process.version

-

The version property contains the node version string, for example "v0.1.103".

+

The node version string, for example "v0.1.103".

process.installPrefix

-

Exposes the installation prefix, in my case "/usr/local", as node's binary was installed to "/usr/local/bin/node".

+

The installation prefix. In my case "/usr/local", as node's binary was installed to "/usr/local/bin/node".

process.execPath

-

Path to the executable itself "/usr/local/bin/node".

+

The path to the executable itself "/usr/local/bin/node".

process.platform

-

Exposes a string indicating the platform you are running on, for example "darwin".

+

The platform you are running on. For example, "darwin".

process.pid

@@ -374,7 +374,7 @@

process.pid

process.cwd()

-

Returns the current working directory, for example:

+

Returns the current working directory. For example:

cd ~ && node
 node> process.cwd()
@@ -402,11 +402,11 @@ 

process.getgid()

process.setgid()

-

Similar to process.setuid() however operates on the group, also accepting a numerical value or string representation. For example process.setgid(20) or process.setgid('www').

+

Similar to process.setuid() however operates on the group, also accepting a numerical value or string representation. For example, process.setgid(20) or process.setgid('www').

process.env

-

An object containing the user's environment variables, for example:

+

An object containing the user's environment variables. For example:

{ PATH: '/Users/tj/.gem/ruby/1.8/bin:/Users/tj/.nvm/current/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin'
 , PWD: '/Users/tj/ebooks/masteringnode'
@@ -425,7 +425,7 @@ 

process.argv

When executing a file with the node executable process.argv provides access to the argument vector, the first value being the node executable, second being the filename, and remaining values being the arguments passed.

-

For example our source file ./src/process/misc.js can be executed by running:

+

For example, our source file ./src/process/misc.js can be executed by running:

$ node src/process/misc.js foo bar baz
 
@@ -442,11 +442,11 @@

process.argv

process.exit()

-

The process.exit() method is synonymous with the C function exit(), in which a exit code > 0 is passed indicating failure, or 0 to indicate success. When invoked the exit event is emitted, allowing a short time for arbitrary processing to occur before process.reallyExit() is called with the given status code.

+

The process.exit() method is synonymous with the C function exit(), in which an exit code > 0 is passed to indicate failure, or 0 is passed to indicate success. When invoked, the exit event is emitted, allowing a short time for arbitrary processing to occur before process.reallyExit() is called with the given status code.

process.on()

-

The process itself is an EventEmitter, allowing you to do things like listen for uncaught exceptions, via the uncaughtException event:

+

The process itself is an EventEmitter, allowing you to do things like listen for uncaught exceptions via the uncaughtException event:

process.on('uncaughtException', function(err){
     console.log('got an error: %s', err.message);
@@ -460,7 +460,7 @@ 

process.on()

process.kill()

-

process.kill() method sends the signal passed to the given pid, defaulting to SIGINT. In our example below we send the SIGTERM signal to the same node process to illustrate signal trapping, after which we output "terminating" and exit. Note that our second timeout of 1000 milliseconds is never reached.

+

process.kill() method sends the signal passed to the given pid, defaulting to SIGINT. In the example below, we send the SIGTERM signal to the same node process to illustrate signal trapping, after which we output "terminating" and exit. Note that the second timeout of 1000 milliseconds is never reached.

process.on('SIGTERM', function(){
     console.log('terminating');
@@ -479,7 +479,7 @@ 

process.kill()

errno

-

The process object is host of the error numbers, these reference what you would find in C-land, for example process.EPERM represents a permission based error, while process.ENOENT represents a missing file or directory. Typically these are used within bindings to bridge the gap between C++ and JavaScript, however useful for handling exceptions as well:

+

The process object is host of the error numbers, which reference what you would find in C-land. For example, process.EPERM represents a permission based error, while process.ENOENT represents a missing file or directory. Typically these are used within bindings to bridge the gap between C++ and JavaScript, but they're useful for handling exceptions as well:

if (err.errno === process.ENOENT) {
     // Display a 404 "Not Found" page
diff --git a/chapters/globals.html b/chapters/globals.html
index 5c3118d..e344b86 100644
--- a/chapters/globals.html
+++ b/chapters/globals.html
@@ -42,24 +42,24 @@ 

console.assert()

process

-

The process object is plastered with goodies, first we will take a look -at some properties that provide information about the node process itself.

+

The process object is plastered with goodies. First we will take a look +at some properties that provide information about the node process itself:

process.version

-

The version property contains the node version string, for example "v0.1.103".

+

The node version string, for example "v0.1.103".

process.installPrefix

-

Exposes the installation prefix, in my case "/usr/local", as node's binary was installed to "/usr/local/bin/node".

+

The installation prefix. In my case "/usr/local", as node's binary was installed to "/usr/local/bin/node".

process.execPath

-

Path to the executable itself "/usr/local/bin/node".

+

The path to the executable itself "/usr/local/bin/node".

process.platform

-

Exposes a string indicating the platform you are running on, for example "darwin".

+

The platform you are running on. For example, "darwin".

process.pid

@@ -67,7 +67,7 @@

process.pid

process.cwd()

-

Returns the current working directory, for example:

+

Returns the current working directory. For example:

cd ~ && node
 node> process.cwd()
@@ -95,11 +95,11 @@ 

process.getgid()

process.setgid()

-

Similar to process.setuid() however operates on the group, also accepting a numerical value or string representation. For example process.setgid(20) or process.setgid('www').

+

Similar to process.setuid() however operates on the group, also accepting a numerical value or string representation. For example, process.setgid(20) or process.setgid('www').

process.env

-

An object containing the user's environment variables, for example:

+

An object containing the user's environment variables. For example:

{ PATH: '/Users/tj/.gem/ruby/1.8/bin:/Users/tj/.nvm/current/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin'
 , PWD: '/Users/tj/ebooks/masteringnode'
@@ -118,7 +118,7 @@ 

process.argv

When executing a file with the node executable process.argv provides access to the argument vector, the first value being the node executable, second being the filename, and remaining values being the arguments passed.

-

For example our source file ./src/process/misc.js can be executed by running:

+

For example, our source file ./src/process/misc.js can be executed by running:

$ node src/process/misc.js foo bar baz
 
@@ -135,11 +135,11 @@

process.argv

process.exit()

-

The process.exit() method is synonymous with the C function exit(), in which a exit code > 0 is passed indicating failure, or 0 to indicate success. When invoked the exit event is emitted, allowing a short time for arbitrary processing to occur before process.reallyExit() is called with the given status code.

+

The process.exit() method is synonymous with the C function exit(), in which an exit code > 0 is passed to indicate failure, or 0 is passed to indicate success. When invoked, the exit event is emitted, allowing a short time for arbitrary processing to occur before process.reallyExit() is called with the given status code.

process.on()

-

The process itself is an EventEmitter, allowing you to do things like listen for uncaught exceptions, via the uncaughtException event:

+

The process itself is an EventEmitter, allowing you to do things like listen for uncaught exceptions via the uncaughtException event:

process.on('uncaughtException', function(err){
     console.log('got an error: %s', err.message);
@@ -153,7 +153,7 @@ 

process.on()

process.kill()

-

process.kill() method sends the signal passed to the given pid, defaulting to SIGINT. In our example below we send the SIGTERM signal to the same node process to illustrate signal trapping, after which we output "terminating" and exit. Note that our second timeout of 1000 milliseconds is never reached.

+

process.kill() method sends the signal passed to the given pid, defaulting to SIGINT. In the example below, we send the SIGTERM signal to the same node process to illustrate signal trapping, after which we output "terminating" and exit. Note that the second timeout of 1000 milliseconds is never reached.

process.on('SIGTERM', function(){
     console.log('terminating');
@@ -172,7 +172,7 @@ 

process.kill()

errno

-

The process object is host of the error numbers, these reference what you would find in C-land, for example process.EPERM represents a permission based error, while process.ENOENT represents a missing file or directory. Typically these are used within bindings to bridge the gap between C++ and JavaScript, however useful for handling exceptions as well:

+

The process object is host of the error numbers, which reference what you would find in C-land. For example, process.EPERM represents a permission based error, while process.ENOENT represents a missing file or directory. Typically these are used within bindings to bridge the gap between C++ and JavaScript, but they're useful for handling exceptions as well:

if (err.errno === process.ENOENT) {
     // Display a 404 "Not Found" page
diff --git a/chapters/globals.md b/chapters/globals.md
index 25943e5..c069f87 100644
--- a/chapters/globals.md
+++ b/chapters/globals.md
@@ -39,24 +39,24 @@ Asserts that the given expression is truthy, or throws an exception.
 
 ## process
 
-The `process` object is plastered with goodies, first we will take a look
-at some properties that provide information about the node process itself.
+The `process` object is plastered with goodies. First we will take a look
+at some properties that provide information about the node process itself:
 
 ### process.version
 
-The version property contains the node version string, for example "v0.1.103".
+The node version string, for example "v0.1.103".
 
 ### process.installPrefix
 
-Exposes the installation prefix, in my case "_/usr/local_", as node's binary was installed to "_/usr/local/bin/node_".
+The installation prefix. In my case "_/usr/local_", as node's binary was installed to "_/usr/local/bin/node_".
 
 ### process.execPath
 
-Path to the executable itself "_/usr/local/bin/node_".
+The path to the executable itself "_/usr/local/bin/node_".
 
 ### process.platform
 
-Exposes a string indicating the platform you are running on, for example "darwin".
+The platform you are running on. For example, "darwin".
 
 ### process.pid
 
@@ -64,7 +64,7 @@ The process id.
 
 ### process.cwd()
 
-Returns the current working directory, for example:
+Returns the current working directory. For example:
 
     cd ~ && node
     node> process.cwd()
@@ -90,11 +90,11 @@ Returns the numerical group id of the running process.
 
 ### process.setgid()
 
-Similar to `process.setuid()` however operates on the group, also accepting a numerical value or string representation. For example `process.setgid(20)` or `process.setgid('www')`.
+Similar to `process.setuid()` however operates on the group, also accepting a numerical value or string representation. For example, `process.setgid(20)` or `process.setgid('www')`.
 
 ### process.env
 
-An object containing the user's environment variables, for example:
+An object containing the user's environment variables. For example:
 
     { PATH: '/Users/tj/.gem/ruby/1.8/bin:/Users/tj/.nvm/current/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin'
 	, PWD: '/Users/tj/ebooks/masteringnode'
@@ -112,7 +112,7 @@ An object containing the user's environment variables, for example:
 
 When executing a file with the `node` executable `process.argv` provides access to the argument vector, the first value being the node executable, second being the filename, and remaining values being the arguments passed.
 
-For example our source file _./src/process/misc.js_ can be executed by running:
+For example, our source file _./src/process/misc.js_ can be executed by running:
 
     $ node src/process/misc.js foo bar baz
 
@@ -127,11 +127,11 @@ in which we call `console.dir(process.argv)`, outputting the following:
 
 ### process.exit()
 
-The `process.exit()` method is synonymous with the C function `exit()`, in which a exit code > 0 is passed indicating failure, or 0 to indicate success. When invoked the _exit_ event is emitted, allowing a short time for arbitrary processing to occur before `process.reallyExit()` is called with the given status code.
+The `process.exit()` method is synonymous with the C function `exit()`, in which an exit code > 0 is passed to indicate failure, or 0 is passed to indicate success. When invoked, the _exit_ event is emitted, allowing a short time for arbitrary processing to occur before `process.reallyExit()` is called with the given status code.
 
 ### process.on()
 
-The process itself is an `EventEmitter`, allowing you to do things like listen for uncaught exceptions, via the _uncaughtException_ event:
+The process itself is an `EventEmitter`, allowing you to do things like listen for uncaught exceptions via the _uncaughtException_ event:
 
 	process.on('uncaughtException', function(err){
 	    console.log('got an error: %s', err.message);
@@ -144,7 +144,7 @@ The process itself is an `EventEmitter`, allowing you to do things like listen f
 
 ### process.kill()
 
-`process.kill()` method sends the signal passed to the given _pid_, defaulting to **SIGINT**. In our example below we send the **SIGTERM** signal to the same node process to illustrate signal trapping, after which we output "terminating" and exit. Note that our second timeout of 1000 milliseconds is never reached.
+`process.kill()` method sends the signal passed to the given _pid_, defaulting to **SIGINT**. In the example below, we send the **SIGTERM** signal to the same node process to illustrate signal trapping, after which we output "terminating" and exit. Note that the second timeout of 1000 milliseconds is never reached.
 
 	process.on('SIGTERM', function(){
 	    console.log('terminating');
@@ -162,7 +162,7 @@ The process itself is an `EventEmitter`, allowing you to do things like listen f
 
 ### errno
 
-The `process` object is host of the error numbers, these reference what you would find in C-land, for example `process.EPERM` represents a permission based error, while `process.ENOENT` represents a missing file or directory. Typically these are used within bindings to bridge the gap between C++ and JavaScript, however useful for handling exceptions as well:
+The `process` object is host of the error numbers, which  reference what you would find in C-land. For example, `process.EPERM` represents a permission based error, while `process.ENOENT` represents a missing file or directory. Typically these are used within bindings to bridge the gap between C++ and JavaScript, but they're useful for handling exceptions as well:
 
     if (err.errno === process.ENOENT) {
 		// Display a 404 "Not Found" page