万本电子书0元读

万本电子书0元读

顶部广告

Learning Node.js for .NET Developers电子书

售       价:¥

1人正在读 | 0人评论 9.8

作       者:Harry Cummings

出  版  社:Packt Publishing

出版时间:2016-06-01

字       数:160.9万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Solve practical real-world problems using JavaScript and Node.js About This Book Learn the concepts of Node.js to gain a high-level understanding of the Node.js execution model Build an interactive web application with MongoDB and Redis and create your own JavaScript modules that work both on the client side and server side Familiarize yourself with the new features of Node.js and JavaScript with this exclusive step-by-step guide Who This Book Is For This book is for developers who want to learn JavaScript and Node.js. Previous experience with programming is desired, but no JavaScript or Node.js knowledge is required. The book focuses mostly on web development, such as networking, serving dynamic pages, and real-time client-server communication. What You Will Learn Understand which problems Node.js best solves Write idiomatic JavaScript and Node.js code Build web applications and command-line tools Minimise complexity and efficiently solve difficult problems Test and deploy Node.js applications Work with persistent data Implement real-time client-server applications Integrate .NET and Node.js code In Detail Node.js is an open source, cross-platform runtime environment that allows you to use JavaScript to develop server-side web applications. This short guide will help you develop applications using JavaScript and Node.js, leverage your existing programming skills from .NET or Java, and make the most of these other platforms through understanding the Node.js programming model. You will learn how to build web applications and APIs in Node, discover packages in the Node.js ecosystem, test and deploy your Node.js code, and more. Finally, you will discover how to integrate Node.js and .NET code. Style and approach This is a step-by-step and practical guide to Node.js for .Net developers. It covers the fundamentals relating to typical applications. The focus is on providing the practical skills required to develop applications, with a summary of the key concepts covered.
目录展开

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

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部