Smashing Node.js - JavaScript Everywhere
Home > Computing and Information Technology > Computer programming / software engineering > Web programming > Smashing Node.js - JavaScript Everywhere
Smashing Node.js - JavaScript Everywhere

Smashing Node.js - JavaScript Everywhere

|
     0     
5
4
3
2
1




Out of Stock


Notify me when this book is in stock
About the Book

Learn to make more efficient apps, with just one language! Smashing Node.js: JavaScript Everywhere equips you with the necessary tools to understand Node.js and its uses in developing efficient web apps. With more traditional web servers becoming obsolete, having knowledge on servers that achieve high scalability and optimal resource consumption using Node.js is the key to your app development success. Teaching you the essentials to making event-driven server-side apps, this book demonstrates how you can use less space and take less time for communication between web client and server. Contains numerous hands-on examples Explains implementation of real-time apps including Socket.IO and HTML5, and WebSockets Addresses practical Node.js advantages from specific design choices Demonstrates why knowledge and use of JavaScript is beneficial Includes an interactive online component with sample chapters Explains components of stand out apps including brevity and benchmarks Looking to enhance your abilities even further? Smashing Node.js: JavaScript Everywhere makes developing server-side apps accessible with its focus on JavaScript, open source, and easy-to-use language.

Table of Contents:
PART I: GETTING STARTED: SETUP AND CONCEPTS 5 Chapter 1: The Setup 7 Installing on Windows 8 Installing on OS X 8 Installing on Linux 8 Compiling 9 Ensuring that it works 9 The Node REPL 9 Executing a file 10 NPM 10 Installing modules 11 Defining your own module 12 Installing binary utilities 13 Exploring the NPM registry 14 Summary 14 Chapter 2: JavaScript: An Overview 15 Introduction 15 Basic JavaScript 16 Types 16 Type hiccups 16 Functions 18 this, Function#call, and Function#apply 18 Functionarity 19 Closures 19 Classes 20 Inheritance 20 try {} catch {} 21 v8 JavaScript 22 Object#keys 22 Array#isArray 23 Array methods 23 String methods 24 JSON 24 Function#bind 24 Function#name 24 -proto- (inheritance) 25 Accessors 25 Summary 26 Chapter 3: Blocking and Non-blocking IO 27 With great power comes great responsibility 28 Blocking-ness 29 A single-threaded world 31 Error handling 33 Stack traces 35 Summary 37 Chapter 4: Node JavaScript 39 The global object 40 Useful globals 40 The module system 41 Absolute and relative modules 41 Exposing APIs 44 Events 45 Buffers 47 Summary 48 PART II: ESSENTIAL NODE APIS 49 Chapter 5: CLI and FS APIs: Your First Application 51 Requirements 52 Writing your first program 52 Creating the module 53 Sync or async? 54 Understanding streams 55 Input and ouput 57 Refactoring 59 Interacting with the fs 61 Exploring the CLI 63 Argv 63 Working directory 64 Environmental variables 65 Exiting 65 Signals 65 ANSI escape codes 66 Exploring the fs module 66 Streams 67 Watch 67 Summary 68 Chapter 6: TCP 69 What are the characteristics of TCP? 70 Connection-oriented communication and same-order delivery 70 Byte orientation 70 Reliability 71 Flow control 71 Congestion control 71 Telnet 71 A TCP chat program 74 Creating the module 74 Understanding the net.server API 74 Receiving connections 76 The data event 77 State and keeping track of connections 79 Wrap up 81 An IRC Client program 83 Creating the module 83 Understanding the net#Stream API 84 Implementing part of the IRC protocol 84 Testing with a real-world IRC server 85 Summary 85 Chapter 7: HTTP 87 The structure of HTTP 88 Headers 89 Connections 93 A simple web server 94 Creating the module 95 Printing out the form 95 Methods and URLs 97 Data 99 Putting the pieces together 102 Bullet-proofing 103 A Twitter web client 104 Creating the module 104 Making a simple HTTP request 104 Sending a body of data 106 Getting tweets 107 A superagent to the rescue 110 Reloading HTTP servers with up 111 Summary 112 PART III: WEB DEVELOPMENT 113 Chapter 8: Connect 115 A simple website with HTTP 116 A simple website with Connect 119 Middleware 121 Writing reusable middleware 122 Static middleware 127 Query 128 Logger 129 Body parser 131 Cookies 134 Session 134 REDIS sessions 140 methodOverride 141 basicAuth 141 Summary 144 Chapter 9: Express 145 A simple express app 146 Creating the module 146 HTML 146 Setup 147 Defining routes 148 Search 150 Run 152 Settings 153 Template engines 154 Error handling 155 Convenience methods 155 Routes 157 Middleware 159 Organization strategies 160 Summary 162 Chapter 10: WebSocket 163 AJAX 164 HTML5 WebSocket 166 An Echo Example 167 Setting it up 167 Setting up the server 168 Setting up the client 169 Running the server 170 Mouse cursors 171 Setting up the example 171 Setting up the server 172 Setting up the client 174 Running the server 176 The Challenges Ahead 177 Close doesn't mean disconnect 177 JSON 177 Reconnections 177 Broadcasting 177 WebSockets are HTML5: Older browsers don't support them 177 The solution 178 Summary 178 Chapter 11: Socket.IO 179 Transports 180 Disconnected versus closed 180 Events 180 Namespaces 181 A chat program 182 Setting up the program 182 Setting up the server 182 Setting up the client 183 Events and Broadcasting 185 Ensuring reception 190 A DJ-by-turns application 191 Extending the chat 191 Integrating with the Grooveshark API 193 Playing 196 Summary 201 PART IV: DATABASES 203 Chapter 12: MongoDB 205 Installation 207 Accessing MongoDB: A user authentication example 208 Setting up the application 208 Creating the Express app 208 Connecting to MongoDB 212 Creating documents 214 Finding documents 215 Authentication middleware 217 Validation 218 Atomicity 219 Safe mode 219 Introducing Mongoose 220 Defining a model 220 Defining nested keys 222 Defining embedded documents 222 Setting up indexes 222 Middleware 223 Inspecting the state of the model 223 Querying 224 Extending queries 224 Sorting 224 Making Selections 224 Limiting 225 Skipping 225 Populating keys automatically 225 Casting 225 A mongoose example 226 Setting up the application 226 Refactoring 226 Setting up models 227 Summary 229 Chapter 13: MySQL 231 node-mysql 232 Setting it up 232 The Express app 232 Connecting to MySQL 234 Initializing the script 234 Creating data 238 Fetching data 242 sequelize 244 Setting up sequelize 245 Setting up the Express app 245 Connecting sequelize 248 Defining models and synchronizing 249 Creating data 250 Retrieving data 253 Removing data 254 Wrapping up 256 Summary 257 Chapter 14: Redis 259 Installing Redis 261 The Redis query language 261 Data types 262 Strings 263 Hashes 263 Lists 265 Sets 265 Sorted sets 266 Redis and Node 266 Implementing a social graph with node-redis 267 Summary 276 PART V: TESTING 277 Chapter 15: Code Sharing 279 What can be shared? 280 Writing compatible JavaScript 280 Exposing modules 280 Shimming ECMA APIs 282 Shimming Node APIs 283 Shimming browser APIs 284 Cross-browser inheritance 284 Putting it all together: browserbuild 285 A basic example 286 Summary 288 Chapter 16: Testing 289 Simple testing 290 The test subject 290 The test strategy 290 The test program 291 Expect.JS 292 API overview 292 Mocha 294 Testing asynchronous code 295 BDD style 297 TDD style 298 Exports style 298 Taking Mocha to the browser 299 Summary 300


Best Sellers


Product Details
  • ISBN-13: 9781119962595
  • Publisher: John Wiley & Sons Inc
  • Publisher Imprint: John Wiley & Sons Inc
  • Height: 2276 mm
  • No of Pages: 320
  • Spine Width: 172 mm
  • Width: 1877 mm
  • ISBN-10: 1119962595
  • Publisher Date: 04 Sep 2012
  • Binding: Paperback
  • Language: English
  • Returnable: N
  • Weight: 1 gr


Similar Products

Add Photo
Add Photo

Customer Reviews

REVIEWS      0     
Click Here To Be The First to Review this Product
Smashing Node.js - JavaScript Everywhere
John Wiley & Sons Inc -
Smashing Node.js - JavaScript Everywhere
Writing guidlines
We want to publish your review, so please:
  • keep your review on the product. Review's that defame author's character will be rejected.
  • Keep your review focused on the product.
  • Avoid writing about customer service. contact us instead if you have issue requiring immediate attention.
  • Refrain from mentioning competitors or the specific price you paid for the product.
  • Do not include any personally identifiable information, such as full names.

Smashing Node.js - JavaScript Everywhere

Required fields are marked with *

Review Title*
Review
    Add Photo Add up to 6 photos
    Would you recommend this product to a friend?
    Tag this Book Read more
    Does your review contain spoilers?
    What type of reader best describes you?
    I agree to the terms & conditions
    You may receive emails regarding this submission. Any emails will include the ability to opt-out of future communications.

    CUSTOMER RATINGS AND REVIEWS AND QUESTIONS AND ANSWERS TERMS OF USE

    These Terms of Use govern your conduct associated with the Customer Ratings and Reviews and/or Questions and Answers service offered by Bookswagon (the "CRR Service").


    By submitting any content to Bookswagon, you guarantee that:
    • You are the sole author and owner of the intellectual property rights in the content;
    • All "moral rights" that you may have in such content have been voluntarily waived by you;
    • All content that you post is accurate;
    • You are at least 13 years old;
    • Use of the content you supply does not violate these Terms of Use and will not cause injury to any person or entity.
    You further agree that you may not submit any content:
    • That is known by you to be false, inaccurate or misleading;
    • That infringes any third party's copyright, patent, trademark, trade secret or other proprietary rights or rights of publicity or privacy;
    • That violates any law, statute, ordinance or regulation (including, but not limited to, those governing, consumer protection, unfair competition, anti-discrimination or false advertising);
    • That is, or may reasonably be considered to be, defamatory, libelous, hateful, racially or religiously biased or offensive, unlawfully threatening or unlawfully harassing to any individual, partnership or corporation;
    • For which you were compensated or granted any consideration by any unapproved third party;
    • That includes any information that references other websites, addresses, email addresses, contact information or phone numbers;
    • That contains any computer viruses, worms or other potentially damaging computer programs or files.
    You agree to indemnify and hold Bookswagon (and its officers, directors, agents, subsidiaries, joint ventures, employees and third-party service providers, including but not limited to Bazaarvoice, Inc.), harmless from all claims, demands, and damages (actual and consequential) of every kind and nature, known and unknown including reasonable attorneys' fees, arising out of a breach of your representations and warranties set forth above, or your violation of any law or the rights of a third party.


    For any content that you submit, you grant Bookswagon a perpetual, irrevocable, royalty-free, transferable right and license to use, copy, modify, delete in its entirety, adapt, publish, translate, create derivative works from and/or sell, transfer, and/or distribute such content and/or incorporate such content into any form, medium or technology throughout the world without compensation to you. Additionally,  Bookswagon may transfer or share any personal information that you submit with its third-party service providers, including but not limited to Bazaarvoice, Inc. in accordance with  Privacy Policy


    All content that you submit may be used at Bookswagon's sole discretion. Bookswagon reserves the right to change, condense, withhold publication, remove or delete any content on Bookswagon's website that Bookswagon deems, in its sole discretion, to violate the content guidelines or any other provision of these Terms of Use.  Bookswagon does not guarantee that you will have any recourse through Bookswagon to edit or delete any content you have submitted. Ratings and written comments are generally posted within two to four business days. However, Bookswagon reserves the right to remove or to refuse to post any submission to the extent authorized by law. You acknowledge that you, not Bookswagon, are responsible for the contents of your submission. None of the content that you submit shall be subject to any obligation of confidence on the part of Bookswagon, its agents, subsidiaries, affiliates, partners or third party service providers (including but not limited to Bazaarvoice, Inc.)and their respective directors, officers and employees.

    Accept

    New Arrivals

    Inspired by your browsing history


    Your review has been submitted!

    You've already reviewed this product!