📜 ⬆️ ⬇️

The book "Learning Node. Go to the server side. 2nd ed. supplemented and revised "

image Node.js technology is still young and at the same time exists long enough for large corporations (LinkedIn, Yahoo! and Netflix) to put it into service.

This book is about Node and the modules that make up the basic Node functionality. You will begin to get acquainted with the basics of creating a web server and basic functionality, and then go to the module system, REPL, application development, security issues, child processes, learn new functionality introduced in ES6, integrated development (Express, MongoDB, Redis, AngularJS and Backbone.js), application development techniques, and finally, using Node in other areas, such as microcontrollers and the Internet of Things.

Who is this book written for?



In my (author's) opinion, the readers of this book fall into two categories.
')
The first one includes developers who created client applications with different libraries and frameworks and now want to transfer their skills in owning JavaScript to the server side.

The second category includes server application developers who want to try something new or switch to a more modern technology. They worked in Java or C ++, Ruby or PHP, and now they want to learn the JavaScript language and integrate it with their knowledge of the server environment.

These two seemingly different audiences have one common knowledge: JavaScript (or ECMAScript, to be more precise). The reader of this book should be very confident in the language of JavaScript. There is another similarity: both categories will have to learn the same basic Node, including the basic Node API.

However, each category looks at the study of Node from its own point of view and is guided by its own skills. To make the book more useful, I tried to present the material from both points of view. For example, a C ++ or Java developer may be interested in creating add-ons for Node in C ++, which is unlikely to be of interest to the client application developer. At the same time, concepts such as direct or inverse byte order may be very familiar to server application developers, but not to client programming specialists. I cannot profoundly present any of these perspectives, but I will try to make the material not seem too complicated or boring to any reader.

I’m definitely not going to make you memorize anything. The book will present the API of the base modules, but I will not describe all the objects and all the functions, because they are documented on the Node site. Instead, I will try to consider the most important aspects of all the basic modules and the specific Node functionality, which, in my opinion, is especially important so that you are not inferior to other Node developers. Of course, practice is the main success factor, and this book is a learning tool. Turning the last page of the book, you will be able to go independently to an in-depth study of specific types of functionality, for example, working with the family of MEAN technologies (Mongo-Express-Angular-Node). The material of the book will be the starting point from which you can go to any of the Node directions you are interested in.

Book structure


This book focuses on the basics. It is dedicated to Node and those modules that form the basic Node functionality. Of course, I will mention a number of third-party modules and describe in detail npm, but the main goal of this book is to give the reader an idea of ​​the basic functionality of Node. And when you confidently stand on your feet, you can go in the right direction.

Chapter 1 introduces the reader to Node; it also includes a brief description of the installation procedure. You will have the opportunity to try out Node in practice: first we will create a web server from the Node documentation, and then a more complex server, the code of which is given in the book. In addition, the topic of creating Node add-ons for readers programming in C / C ++ will be touched upon. And is it possible to imagine an introduction to Node without a review of the development history of the environment, the first version of which was assigned the number 4.0 instead of 1.0?

Chapter 2 discusses the most important Node functionality: event handling principles, global objects needed to create Node applications, and the asynchronous nature of Node. There will also be a buffer object — a data structure transmitted by many Node network functions.

Chapter 3 describes in detail the system of Node modules, and also contains a detailed description of the npm, a system for managing Node modules from independent developers. In this chapter, you will learn how the application looks for the Node modules used and how to create your own Node module. Next, to represent the more complex aspects of the Node functionality, support for sandboxing will be explored. Just for fun, I will also introduce three popular Node modules from independent developers: Async, Commander and Underscore.

The interactive console included in the Node distribution and known as the REPL is an invaluable learning tool and learning environment. A separate chapter is devoted to the REPL. I will explain how to use this tool, and how to create your own, specialized modification of the REPL.

Developing Node applications for the Internet is discussed in Chapter 5. In particular, we will take a closer look at the Node modules that provide tools for web development. You will see what it takes to create a full-featured web server for static files, and learn how to run Node applications in combination with Apache using an Apache proxy.

Chapter 7 is devoted to network support, and it’s impossible to talk about networks without discussing a security issue. These two themes always go hand in hand - like peanut butter and jam, like chocolate and ... whatever. I will talk about TCP and UDP support in Node, as well as how to implement an HTTPS server (in addition to the HTTP server, the creation of which was discussed in Chapter 5). It will also describe the mechanics of digital certificates, the principles of the SSL (Secure Sockets Layer) protocol and its updated version of TLS (Transport Layer Security). The chapter concludes with a description of the Node cryptographic module and work with password hashes.

One of the most enjoyable features of Node is the ability to use the functionality of the operating system using child processes. Some of my favorite Node apps are small utilities for working with compressed files, the popular graphic application ImageMagick, and a program for capturing screenshots on websites. Of course, they do not impress against the background of trendy applications with ingenious cloud-based interfaces, but they are great for learning how to work with child processes. Child processes are discussed in Chapter 8.

Most of the book’s examples use the JavaScript language that you’ve been working with for more than a year. However, one of the main reasons for the Node.js / io.js division and the emergence of a new, unified product was the support of new versions of ECMAScript, such as ES6 (or ECMAScript 2015, if you like). In Chapter 9, I will talk about what is currently supported in Node, what the implications of new functionality lead to, as well as when and how to use the new functionality instead of the old one. There will also be described some of the subtleties associated with the use of new features of JavaScript. I deviate from the description of the built-in functionality only once: when I describe the implementation of promises (promises) in the very popular Bluebird module.

Chapter 10 discusses the frameworks and functionality that make up the so-called Node complex development. I will talk about Express - a framework that is very often used in the development of Node applications. You will also try out MongoDB and Redis in practice and get to know a couple of frameworks that provide “complexity” in the Node: AngularJS and Backbone.js integrated development concept.

After you write the code for the Node application, it will go into operation. Chapter 11 discusses the tools and techniques for developing Node applications and ensuring their operation, including unit, load and benchmark testing, basic debugging techniques and tools. In addition, I will talk about how to organize application recovery after a crash.

Chapter 12 is a kind of "dessert." It discusses some of the possibilities for transferring your new Node skills to other areas, including the world of microcontrollers / microcomputers as part of the “Internet of things”, and the version of Node that does not work on the basis of V8.

»More information about the book can be found on the publisher's website.
» Table of Contents
» Excerpt

For Habrozhiteley a 25% discount on the coupon - Node

Source: https://habr.com/ru/post/321310/


All Articles