Skip to content

Commit 3943a36

Browse files
committed
change to I in images everywhere in text
1 parent 1f3cd1c commit 3943a36

File tree

10 files changed

+59
-59
lines changed

10 files changed

+59
-59
lines changed

Chapter1/chapter1.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ First, let’s go to <http://nodejs.org> and download a one-click installer for
2929

3030
The installers come with NPM (Node Package Manager)— an important tool for managing dependencies.
3131

32-
![alt](media/image1.png)
32+
![alt](media/Image1.png)
3333

3434
***Figure 1-1.** One-click installers for Node.js*
3535

3636
If there’s no installer for your OS (page http://nodejs.org/download/), you can get the source code and compile it yourself (Figure 1-2).
3737

38-
![alt](media/image2.png)
38+
![alt](media/Image2.png)
3939

4040
***Figure 1-2.** Multiple options for downloading*
4141

@@ -240,7 +240,7 @@ $ npm -v
240240

241241
You should see the latest versions of Node.js and NPM that you just downloaded and installed, as shown in Figure 1-3.
242242

243-
![alt](media/image3.png)
243+
![alt](media/Image3.png)
244244

245245
***Figure 1-3.** Checking Node.js and NPM installations*
246246

@@ -267,7 +267,7 @@ The prompt should change from `$` to `>` (or something else, depending on your s
267267

268268
The result of the previous snippet is shown in Figure 1-4.
269269

270-
![alt](media/image4.png)
270+
![alt](media/Image4.png)
271271

272272
***Figure 1-4.** Executing JavaScript in Node.js REPL*
273273

@@ -535,7 +535,7 @@ So, let’s take a look at the main differences between Node.js and JavaScript.
535535
536536
Each Node.js script that runs is, in essence, a process. For example, `ps aux | grep 'node'` outputs all Node.js programs running on a machine. Conveniently, developers can access useful process information in code with the `process` object (e.g., `node -e "console.log(process.pid)"`), as shown in Figure 1-5.
537537
538-
![alt](media/image5.png)
538+
![alt](media/Image5.png)
539539
540540
***Figure 1-5.** Node.js process examples using `pid` (process ID) and `cwd` (current working directory).*
541541
@@ -903,7 +903,7 @@ Then, we start Node Inspector with the following (Figure 1-6):
903903
904904
$ node-inspector
905905
906-
![alt](media/image6.png)
906+
![alt](media/Image6.png)
907907
908908
***Figure 1-6.** Running the Node Inspector tool*
909909
@@ -915,33 +915,33 @@ or
915915
916916
$ node --debug hello-debug.js
917917
918-
![alt](media/image7.png)
918+
![alt](media/Image7.png)
919919
920920
***Figure 1-7.** Running node server in `--debug` mode*
921921
922922
Open <http://127.0.0.1:8080/debug?port=5858> (or http://localhost:8080/debug?port=5858) in Chrome (it must be Chrome and not another browser because Node Inspector uses the Web Developer Tools interface). You should be able to see the program halted at a break point. Clicking the blue play button resumes the execution, as shown in Figure 1-8.
923923
924-
![alt](media/image8.png)
924+
![alt](media/Image8.png)
925925
926926
***Figure 1-8.** Resuming execution in Node Inspector*
927927
928928
If we let the server run and open <http://localhost:1337/> in a new browser tab, this action pauses the execution on the second break point, which is inside the request handler. From here, we can use Node Inspector’s right GUI and add a `res` watcher (Figure 1-9), which is way better than the terminal window output!
929929
930-
![alt](media/image9.png)
930+
![alt](media/Image9.png)
931931
932932
***Figure 1-9.** Inspecting `res` object in Node Inspector*
933933
934934
In addition, we can follow the call stack, explore scope variables, and execute any Node.js command in the console tab (Figure 1-10)!
935935
936-
![alt](media/image10.png)
936+
![alt](media/Image10.png)
937937
938938
***Figure 1-10.** Writing to response (i.e., the `res` object) from the Node Inspector console*
939939
940940
# Node.js IDEs and Code Editors
941941
942942
One of the best things about Node.js is that you don’t need to compile the code, because it’s loaded into memory and interpreted by the platform! Therefore, a lightweight text editor is highly recommended, such as Sublime Text (Figure 1-11), vs. a full-blown IDE. However, if you are already familiar and comfortable with the IDE of your choice, such as [Eclipse](http://www.eclipse.org/)(<http://www.eclipse.org/>), [NetBeans](http://netbeans.org/)(<http://netbeans.org/>), or [Aptana](http://aptana.com)(<http://aptana.com/>), feel free to stick with it.
943943
944-
![alt](media/image11.png)
944+
![alt](media/Image11.png)
945945
946946
***Figure 1-11.** Sublime Text code editor home page.*
947947
@@ -959,13 +959,13 @@ The following is a list of the most popular text editors and IDEs used in web de
959959
960960
- [*WebStorm IDE*](*http://www.jetbrains.com/webstorm/*)(*<http://www.jetbrains.com/webstorm/>*): a feature-rich IDE that allows for Node.js debugging, developed by JetBrains and marketed as “the smartest JavaScript IDE” (Figure 1-12)
961961
962-
![alt](media/image12.png)
962+
![alt](media/Image12.png)
963963
964964
***Figure 1-12.** WebStorm IDE home page.*
965965
966966
For most developers, a simple code editor such as Sublime Text 2, TextMate, or Emacs is good enough. However, for programmers who are used to working in IDEs, there’s WebStorm by JetBrains (http://www.jetbrains.com/webstorm). For an example of the WebStorm work space, see Figure 1-13.
967967
968-
![alt](media/image13.png)
968+
![alt](media/Image13.png)
969969
970970
***Figure 1-13.** Webstorm IDE work space*
971971

Chapter10/chapter10.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -507,13 +507,13 @@ The full source code of `practicalnode/ch10/cluster.js` is as follows:
507507

508508
As usual, to start an app, run `$ node cluster`. There should be four (or two, depending on your machine’s architecture) processes, as shown in Figure 10-1.
509509

510-
![alt](media/image1.png)
510+
![alt](media/Image1.png)
511511

512512
***Figure 10-1.** Starting four processes with Cluster*
513513

514514
When we CURL with `$ curl http://localhost:3000`, there are different processes that listen to the *same* port and respond to us (Figure 10-2).
515515

516-
![alt](media/image2.png)
516+
![alt](media/Image2.png)
517517

518518
***Figure 10-2.** Server response is rendered by different processes*
519519

@@ -933,7 +933,7 @@ To run the task, simply execute `$ grunt` or `$ grunt default`.
933933

934934
The results of running `$ grunt `are shown in Figure 10-3.
935935

936-
![alt](media/image3.png)
936+
![alt](media/Image3.png)
937937

938938
***Figure 10-3.** The results of the Grunt default task*
939939

@@ -967,7 +967,7 @@ To install Git for your OS, download a package from [the official website](http:
967967

968968
git version 1.8.3.2
969969

970-
![alt](media/image4.png)
970+
![alt](media/Image4.png)
971971

972972
**Figure 10-4.** Configuring and testing the Git installation
973973

@@ -997,7 +997,7 @@ To generate SSH keys for GitHub on Mac OS X/Unix machines, do the following:
997997

998998
$ pbcopy < ~/.ssh/id_rsa.pub
999999

1000-
![alt](media/image5.png)
1000+
![alt](media/Image5.png)
10011001

10021002
***Figure 10-5.** Generating an RSA (Ron Rivest (<http://en.wikipedia.org/wiki/Ron_Rivest>), Adi Shamir (<http://en.wikipedia.org/wiki/Adi_Shamir>) and Leonard Adleman (<http://en.wikipedia.org/wiki/Leonard_Adleman>)) key pair for SSH and copying the public RSA key to a clipboard*
10031003

@@ -1026,7 +1026,7 @@ then everything is set up.
10261026

10271027
While connecting to GitHub for the first time, you may receive the warning “authenticity of host . . . can’t be established.” Please don’t be confused with this message; just proceed by answering yes, as shown in Figure 10-6.
10281028

1029-
![alt](media/image6.png)
1029+
![alt](media/Image6.png)
10301030

10311031
***Figure 10-6.** Testing the SSH connection to GitHub for the very first
10321032
time*

Chapter11/chapter11.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ To set up Heroku, follow these steps:
5252

5353
The system asks you for Heroku credentials (username and password), and if you’ve already created the SSH key, it uploads it automatically to the Heroku web site, as shown in Figure 11-1.
5454

55-
![alt](media/image1.png)
55+
![alt](media/Image1.png)
5656

5757
***Figure 11-1.** The response to a successful `$ heroku login` command*
5858

@@ -174,7 +174,7 @@ For official information on setting up environment variables in Heroku, see [Con
174174

175175
There are a multitude of [add-ons for Heroku](https://addons.heroku.com/) (https://addons.heroku.com). Each add-on is like a mini service associated with a particular Heroku app. For example, [MongoHQ](https://addons.heroku.com/mongohq) (https://addons.heroku.com/mongohq) provides MongoDB database, while the [Postgres add-on](https://addons.heroku.com/heroku-postgresql) (https://addons.heroku.com/heroku-postgresql) does the same for the PostgreSQL database, and [SendGrid](https://addons.heroku.com/sendgrid) (https://addons.heroku.com/sendgrid) allows sending transactional e-mails. In Figure 11-2, you can see the beginning of the long list of Heroku add-ons.
176176

177-
![alt](media/image2.png)
177+
![alt](media/Image2.png)
178178

179179
***Figure 11-2.** There are a multitude of add-ons for Heroku*
180180

@@ -313,13 +313,13 @@ The other fields fill automatically:
313313
Port Range: 80
314314
Source: 0.0.0.0/0
315315

316-
![alt](media/image3.png)
316+
![alt](media/Image3.png)
317317

318318
***Figure 11-3.** Allowing inbound HTTP traffic on port 80*
319319

320320
Or we can just allow all traffic (again, for development purposes only), as shown in Figure 11-4.
321321

322-
![alt](media/image4.png)
322+
![alt](media/Image4.png)
323323

324324
***Figure 11-4**. Allowing all traffic for development mode only*
325325

Chapter2/chapter2.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,15 @@ Of course, we can be more vague and tell NPM to install the latest version of `e
170170

171171
The Figure 2-1 shows us results of running the aforementioned command. Please notice the path in Figure 2-1: `/usr/local/lib/node_modules/express-generator`. This is where, on Max OS X / Linux systems, NPM puts global modules by default. We verify the availability of Express.js CLI by running `$ express –V`.
172172

173-
![alt](media/image1.png)
173+
![alt](media/Image1.png)
174174

175175
***Figure 2-1.** The result of running NPM with `-g` and `$ express -V`*
176176

177177
## Local Express.js
178178

179179
For the local Express.js 4.1.2 module installation, let&#39;s create a new folder `express-cli` somewhere on your computer: `$ mkdir express-cli`. This will be our project folder for the chapter. Now we can open it with `$ cd express-cli`. When we are inside the project folder, we can create `package.json` manually in a text editor or with the `$ npm init` terminal command (Figure 2-2).
180180

181-
![alt](media/image2.png)
181+
![alt](media/Image2.png)
182182

183183
***Figure 2-2.** The result of running `$ npm init`*
184184

@@ -228,15 +228,15 @@ The following is the `package.json` file with an added Express.js v4.1.2 depende
228228

229229
In the Figure 2-3, we show the result of install Express.js v4.1.2 locally, into the `node_modules` folder. Please notice the path after the `[email protected]` string in Figure 2-3 this time it&#39;s local and not global, as in the case of `express-generator`.
230230

231-
![alt](media/image3.png)
231+
![alt](media/Image3.png)
232232

233233
***Figure 2-3.** The result of running $ npm install*
234234

235235
If you want to install Express.js to an existing project and save the dependency (smart thing to do!) into the `package.json` file, which is already present in that project&#39;s folder, run `$ npm install [email protected] --save`.
236236

237237
To double-check the installation of Express.js and its dependencies, we can run the `$ npm ls` command, as shown in Figure 2-4.
238238

239-
![alt](media/image4.png)
239+
![alt](media/Image4.png)
240240

241241
***Figure 2-4.** The result of running `$ npm ls`*
242242

@@ -283,7 +283,7 @@ Then, as the instructions in the terminal tell us (Figure 2-5), type:
283283

284284
Open the browser of your choice at <http://localhost:3000>.
285285

286-
![alt](media/image5.png)
286+
![alt](media/Image5.png)
287287

288288
***Figure 2-5.** The result of using Express.js Generator*
289289

@@ -452,7 +452,7 @@ Our Blog app consists of five main parts from the user perspective:
452452

453453
- A post article page for adding new content
454454

455-
![alt](media/image6.png)
455+
![alt](media/Image6.png)
456456

457457
***Figure 2-6.** The home page of the Blog app*
458458

@@ -479,19 +479,19 @@ The source code for this mini-project is under `ch2/hello-world` folder of pract
479479

480480
The first approach is traditional and is considered more search engine optimization friendly, but it takes longer for users (especially on mobile) and is not as smooth as the second approach (Figure 2-7).
481481

482-
![alt](media/image7.png)
482+
![alt](media/Image7.png)
483483

484484
***Figure 2-7.** Traditional server-side approach*
485485

486486
Sending and receiving data via REST API/HTTP requests and rendering HTML on the client side is used with front-end frameworks such as Backbone.js, Angular, Ember, and [many others](http://todomvc.com/)(<http://todomvc.com/>) (Figure 2-8). The use of these frameworks is becoming more and more common nowadays because it allows for more efficiency (HTML is rendered on the client side and only the data are transmitted) and better code organization.
487487

488-
![alt](media/image8.png)
488+
![alt](media/Image8.png)
489489

490490
***Figure 2-8.** REST API approach diagram*
491491

492492
Under the hood, virtually all front-end frameworks use jQuery&#39;s `ajax()` method. So, to give you a realistic example, the admin page uses REST API end points via jQuery `$.ajax()` calls to manipulate the articles, including publish, unpublish, and remove (Figure 2-9).
493493

494-
![alt](media/image9.png)
494+
![alt](media/Image9.png)
495495

496496
***Figure 2-9.** The admin page of Blog*
497497

@@ -535,7 +535,7 @@ Let&#39;s choose a project folder `hello-world`, and create these directories wi
535535

536536
mkdir {public,public/css,public/img,public/js,db,views,views/includes,routes}
537537

538-
![alt](media/image10.png)
538+
![alt](media/Image10.png)
539539

540540
***Figure 2-10.** Setting up folders*
541541

@@ -680,7 +680,7 @@ The next section is where we define routes themselves (the order in `app.js` mat
680680

681681
Figure 2-11 shows how a trivial request might travel across the web and the Express.js app, with the dotted lines being the connection inside it.
682682

683-
![alt](media/image11.png)
683+
![alt](media/Image11.png)
684684

685685
***Figure 2-11.** Following a simple request in an Express.js app*
686686

@@ -773,7 +773,7 @@ There are more advanced examples of Jade included later in this book; but, for n
773773

774774
When we run the `$ node app` command and open browsers at <http://localhost:3000>, we see what appears in Figure 2-12.
775775

776-
![alt](media/image12.png)
776+
![alt](media/Image12.png)
777777

778778
***Figure 2-12.** The Hello World app in action*
779779

Chapter4/chapter4.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ To add a `jade` dependency to your project, or if you&#39;re starting from scrat
387387

388388
- Install and add `jade` to `package.json` with `$ npm install jade –save`. See the results in Figure 4-1.
389389

390-
![alt](media/image1.png)
390+
![alt](media/Image1.png)
391391

392392
***Figure 4-1.** Installing Jade*
393393

@@ -438,7 +438,7 @@ We can extract these variables from multiple sources (databases, file systems, u
438438

439439
In this way, when we run `$ node jade-example.js 'email body'`, we get the output shown in Figure 4-2.
440440

441-
![alt](media/image2.png)
441+
![alt](media/Image2.png)
442442

443443
***Figure 4-2.** The result of `jade-example` output*
444444

@@ -770,7 +770,7 @@ Includes or partials templates in Handlebars are interpreted by the `{{> partial
770770

771771
Developers can install Handlebars via NPM with `$ npm install handlebars` or `$ npm install handlebars --save`, assuming there&#39;s either `node_modules` or `package.json` in the current working directory (see the results of a sample installation in Figure 4-3).
772772

773-
![alt](media/image3.png)
773+
![alt](media/Image3.png)
774774

775775
***Figure 4-3.** Installing Handlebars*
776776

@@ -1098,7 +1098,7 @@ The full code of `index.jade` is as follows:
10981098

10991099
Figure 4-4 shows how the home page looks after adding style sheets.
11001100

1101-
![alt](media/image4.png)
1101+
![alt](media/Image4.png)
11021102

11031103
***Figure 4-4.** The home page*
11041104

@@ -1113,7 +1113,7 @@ The individual article page (Figure 4-5) is relatively unsophisticated because m
11131113
h1= title
11141114
p= text
11151115

1116-
![alt](media/image5.png)
1116+
![alt](media/Image5.png)
11171117

11181118
***Figure 4-5.** The article page*
11191119

@@ -1141,7 +1141,7 @@ Similarly, the login page contains only a form and a button (with the Twitter Bo
11411141

11421142
Figure 4-6 shows how the login page looks.
11431143

1144-
![alt](media/image6.png)
1144+
![alt](media/Image6.png)
11451145

11461146
***Figure 4-6.** The login page*
11471147

@@ -1171,7 +1171,7 @@ The post page (Figure 4-7) has another form. This time, the form contains a text
11711171
p
11721172
button.btn.btn-primary(type="submit") Save
11731173

1174-
![alt](media/image7.png)
1174+
![alt](media/Image7.png)
11751175

11761176
***Figure 4-7.** The post page*
11771177

@@ -1217,7 +1217,7 @@ And, a conditional (ternary) operator (<https://github.com/donpark/hbs>) is used
12171217

12181218
span.glyphicon(class=(article.published)?"glyphicon-pause":"glyphicon-play", title=(article.published)?"Unpublish":"Publish")
12191219

1220-
![alt](media/image8.png)
1220+
![alt](media/Image8.png)
12211221

12221222
***Figure 4-8.** The admin page*
12231223

0 commit comments

Comments
 (0)