售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
Learning Node.js for .NET Developers
Table of Contents
Learning Node.js for .NET Developers
Credits
About the Author
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Why Node.js?
What is Node.js?
Understanding the Node.js execution model
Non-blocking
Event-driven
Single-threaded
Introducing the Node.js ecosystem
Why JavaScript?
A clear canvas
Functional nature
A bright future
When to use Node.js
Writing web applications
Identifying other use cases
Why now?
Summary
2. Getting Started with Node.js
Installing and running Node.js
Choosing an editor
Using an application framework
Getting started with Express
Exploring our Express application
Understanding Express routes and views
Using nodemon for automatic restarts
Creating modular applications with Express
Bootstrapping an Express application
Understanding Express middleware
Implementing error handling
Using Express middleware
Summary
3. A JavaScript Primer
Introducing JavaScript types
JavaScript primitive types
Functional object-oriented programming
Functional programming in JavaScript
Understanding scopes in JavaScript
Strict mode
Object-oriented programming in JavaScript
Programming without classes
Creating objects with the new keyword
Programming with classes
Class-based inheritance
Summary
4. Introducing Node.js Modules
Organizing your codebase
JavaScript module systems
Creating modules in Node.js
Declaring a module with a name and its own scope
Defining functionality provided by the module
Importing a module into another script
Defining a directory-level module
Implementing an Express middleware module
Summary
5. Creating Dynamic Websites
Handling user-submitted data
Communicating via Ajax
Implementing other data operations
Listing data in views
Issuing a delete request from the client
Splitting up Express views using partials
Summary
6. Testing Node.js Applications
Writing a simple test in Node.js
Structuring the codebase for tests
Writing BDD-style tests with Mocha
Resetting state between tests
Using Chai for assertions
Creating test doubles
Creating test doubles using Sinon.JS
Testing an Express application
Simplifying tests using SuperAgent
Full-stack testing with PhantomJS
Summary
7. Setting up an Automated Build
Setting up an integration server
Setting up a public GitHub repository
Building a project on Travis CI
Automating the build process with Gulp
Running tests using Gulp
Checking code style with ESLint
Automatically fixing issues in ESLint
Running ESLint from Gulp
Gathering code coverage statistics
Running integration tests from Gulp
Summary
8. Mastering Asynchronicity
Using the callback pattern for asynchronous code
Exposing the callback pattern
Consuming asynchronous interfaces
Writing cleaner asynchronous code using promises
Implementing promise-based asynchronous code
Consuming the promise pattern
Parallelising operations using promises
Combining asynchronous programming patterns
Summary
9. Persisting Data
Introducing MongoDB
Why choose MongoDB?
Object modeling
JavaScript
Scalability
Getting started with MongoDB
Using the MongoDB shell
Using MongoDB with Express
Persisting objects with Mongoose
Isolating persistence code
Dependency injection in Node.js
Providing dependencies
Running database integration tests on Travis CI
Introducing Redis
Why use Redis?
Installing Redis
Using Redis as a key-value store
Storing structured data in Redis
Building a user ranking system with Redis
Using Redis from Node.js
Testing with redis-js
Implementing user rankings with Redis
Making use of the users service
A note on security
Summary
10. Creating Real-time Web Apps
Understanding options for real-time communication
Introducing Socket.IO
Implementing a chat room with Socket.IO
Scaling real-time Node.js applications
Using Redis as a backend
Integrating Socket.IO with Express
Directing Socket.IO messages
Testing Socket.IO applications
Organizing Socket.IO applications
Exposing real-time updates to the model
Organizing Socket.IO applications using namespaces
Partitioning Socket.IO clients using rooms
Summary
11. Deploying Node.js Applications
Working with Heroku
Setting up a Heroku account and tooling
Running an application locally with Heroku
Deploying an application to Heroku
Working with Heroku logs, config, and services
Setting up MongoDB
Setting up Redis
Deploying from Travis CI
Setting encrypted Travis CI environment variables
Installing Ruby
Creating an encrypted environment variable
Further resources
Summary
12. Authentication in Node.js
Introducing Passport
Choosing an authentication strategy
Understanding third-party authentication
Using Express sessions
Specifying a session secret
Deciding when the session gets saved
Using alternative session stores
Using session middleware
Implementing social login
Setting up a Twitter application
Configuring Passport
Persisting user data with Redis
Configuring Passport with persistence
Hiding functionality from unauthenticated users
Integration testing with Passport
Allowing users to log out
Adding other login providers
Summary
13. Creating JavaScript Packages
Writing universal modules
Comparing Node.js and RequireJS
Supporting the browser environment
Using AMD modules with RequireJS
Isomorphic JavaScript
Writing npm packages
Defining an npm package
Publishing a package to npm
Running automated clients on the web
Releasing a standalone tool to npm
Using Node.js modules in the browser
Controlling Browserify's output
Summary
14. Node.js and Beyond
Understanding Node.js versioning
A brief history of Node.js
Introducing the Node.js LTS schedule
Understanding ECMAScript versioning
Exploring ECMAScript 2015
Understanding ES2015 modules
Using syntax improvements from ES2015
The for... of loop
The spread operator and rest parameters
Destructuring assignment
Introducing generators
Introducing ECMAScript 2016
Going beyond JavaScript
Exploring compile-to-JavaScript languages
TypeScript
CoffeeScript
And beyond...
Introducing a true assembly language for the web
Understanding asm.js
Understanding WebAssembly
JavaScript and ASP.NET
Exploring .NET Core
Defining project structure in .NET Core
Managing dependencies in .NET Core
Building web applications in ASP.NET Core
Integration with JavaScript
Server-side JavaScript integration with .NET
Summary
Index
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜