Skip to content
This repository
Browse code

Minor fixes

  • Loading branch information...
commit 93adcc18011eea414664f21bfff57cf0fee872d4 1 parent c42b7b8
Justin S. Leitgeb authored September 06, 2010 visionmedia committed September 07, 2010
2  chapters/events.md
Source Rendered
@@ -20,7 +20,7 @@ Typically an object inherits from _EventEmitter_, however our small example belo
20 20
 
21 21
 ## Inheriting From EventEmitter
22 22
 
23  
-A perhaps more practical use of `EventEmitter`, and commonly used throughout node is to inherit from it. This means we can leave `EventEmitter`'s prototype untouched, while utilizing it's api for our own means of world domination!
  23
+A perhaps more practical use of `EventEmitter`, and commonly used throughout node is to inherit from it. This means we can leave `EventEmitter`'s prototype untouched, while utilizing its api for our own means of world domination!
24 24
 
25 25
 To do so we begin by defining the `Dog` constructor, which of course will bark from time to time, also known as an _event_. Our `Dog` constructor accepts a `name`, followed by `EventEmitter.call(this)`, which invokes the `EventEmitter` function in context to the given argument. Doing this is essentially the same as a "super" or "parent" call in languages that support classes. This is a crucial step, as it allows `EventEmitter` to set up the `_events` property which it utilizes internally to manage callbacks.
26 26
 
4  chapters/globals.md
Source Rendered
@@ -5,7 +5,7 @@
5 5
 
6 6
 ## console
7 7
 
8  
-The `console` object contains several methods which are used to output information to _stdout_ or _stderr_. Lets take a look at what each method does.
  8
+The `console` object contains several methods which are used to output information to _stdout_ or _stderr_. Let's take a look at what each method does.
9 9
 
10 10
 ### console.log()
11 11
 
@@ -162,7 +162,7 @@ The process itself is an `EventEmitter`, allowing you to do things like listen f
162 162
 
163 163
 ### errno
164 164
 
165  
-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:
  165
+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:
166 166
 
167 167
     if (err.errno === process.ENOENT) {
168 168
 		// Display a 404 "Not Found" page
4  chapters/installation.md
Source Rendered
... ...
@@ -1,7 +1,7 @@
1 1
 
2 2
 # Installing Node
3 3
 
4  
-In this chapter we will be looking at the installation and compilation of node. Although there are several ways we may install node, we will be looking at [homebrew](http://github.com/mxcl/homebrew), [nDistro](http://github.com/visionmedia/ndistro), and the most flexible method of course, compiling from source.
  4
+In this chapter we will be looking at the installation and compilation of node. Although there are several ways we may install node, we will be looking at [homebrew](http://github.com/mxcl/homebrew), [nDistro](http://github.com/visionmedia/ndistro), and the most flexible method, of course - compiling from source.
5 5
 
6 6
 ### Homebrew
7 7
 
@@ -34,7 +34,7 @@ Next we can place the contents of our example in _./.ndistro_, and execute _ndis
34 34
 
35 35
     $ ndistro
36 36
 
37  
-Installation of the example took less than 17 seconds on my machine, and outputs the following _stdout_ indicating success, not bad for an entire stack!
  37
+Installation of the example took less than 17 seconds on my machine, and outputs the following _stdout_ indicating success. Not bad for an entire stack!
38 38
 
39 39
 	... installing node-0.1.102-i386
40 40
 	... installing connect
8  chapters/modules.md
Source Rendered
@@ -7,7 +7,7 @@ Although this is ideal, in practice modules are often not portable due to relyin
7 7
 
8 8
 ## Creating Modules
9 9
 
10  
-Lets create a utility module named _utils_, which will contain a `merge()` function to copy the properties of one object to another. Typically in a browser, or environment without CommonJS module support, this may look similar to below, where `utils` is a global variable. 
  10
+Let's create a utility module named _utils_, which will contain a `merge()` function to copy the properties of one object to another. Typically in a browser, or environment without CommonJS module support, this may look similar to below, where `utils` is a global variable. 
11 11
 
12 12
     var utils = {};
13 13
 	  utils.merge = function(obj, other) {};
@@ -174,9 +174,9 @@ Outputs:
174 174
 
175 175
 ## Registering Module Compilers
176 176
 
177  
-Another cool feature that node provides us, is the ability to register compilers for a specific file extension. A good example of this is the CoffeeScript language, which is a ruby/python inspired language compiling to vanilla JavaScript, and through the use of `require.registerExtension()` can do so in an automated fashion. 
  177
+Another cool feature that node provides us is the ability to register compilers for a specific file extension. A good example of this is the CoffeeScript language, which is a ruby/python inspired language compiling to vanilla JavaScript. By using `require.registerExtension()` we can have node compile CoffeeScript to JavaScript in an automated fashion. 
178 178
 
179  
-To illustrate it's usage, lets create a small (and useless) Extended JavaScript language, or "ejs" for our example which will live at _./compiler/example.ejs_, it's syntax will look like this:
  179
+To illustrate its usage, let's create a small (and useless) Extended JavaScript language, or "ejs" for our example which will live at _./compiler/example.ejs_, its syntax will look like this:
180 180
 
181 181
     ::min(a, b) a < b ? a : b
182 182
     ::max(a, b) a > b ? a : b
@@ -186,7 +186,7 @@ which will be compiled to:
186 186
     exports.min = function min(a, b) { return a < b ? a : b }
187 187
     exports.max = function max(a, b) { return a > b ? a : b }
188 188
 
189  
-First lets create the module that will actually be doing the ejs to JavaScript compilation. In this example it is located at _./compiler/extended.js_, and exports a single method named `compile()`. This method accepts a string, which is the raw contents of what node is requiring, transformed to vanilla JavaScript via regular expressions.
  189
+First let's create the module that will actually be doing the ejs to JavaScript compilation. In this example it is located at _./compiler/extended.js_, and exports a single method named `compile()`. This method accepts a string, which is the raw contents of what node is requiring, transformed to vanilla JavaScript via regular expressions.
190 190
 
191 191
 
192 192
     exports.compile = function(str){

0 notes on commit 93adcc1

Please sign in to comment.
Something went wrong with that request. Please try again.