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