Node.JS Guidebook
eBook - ePub

Node.JS Guidebook

Comprehensive guide to learn Node.js

Dhruti Shah

Partager le livre
  1. English
  2. ePUB (adapté aux mobiles)
  3. Disponible sur iOS et Android
eBook - ePub

Node.JS Guidebook

Comprehensive guide to learn Node.js

Dhruti Shah

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

Develop attractive and efficient dynamic web applications using Node.js Key Features

  • Assumes a practical approach of learning.
  • Ample of examples are given along with assignments.
  • Book covers a wide range of topics in Node.js, emphasising on real-world.
  • Simple language is used with clear presentation of topics including Node.js modules, npm, event handling.


Description
The Node.js Guidebook is written and designed keeping in mind readers of varies technical and academic inclinations. Every concept has been explained in detail with appropriate examples and demonstrations with images as applicable. Topics have been aligned from simple to complex for the benefit of a beginner in understanding the technology. The logic of all codes in the examples have been explained appropriately. Concepts have been described in a simple language for easy understanding along with real-world applications of the same.Node.js Guidebook aims to introduce readers to the world of Node.js. Node.js is an open source JavaScript run-time environment that executes JavaScript on server-side. Earlier, JavaScript was used only for client-side scripting, but Node.js supports the creation of dynamic Web applications by using JavaScript for server-side scripting. Node.js has taken the world by a storm by simplifying Web application development thorough the use of readily available and pluggable modules, thus, reducing the overall development time. Whether you are a beginner or an experienced developer, you can learn to design and develop attractive and efficient Web applications using Node.js. What Will You Learn
This book will help developers to easily develop attractive and efficient dynamic web applications using Node.js. It will be a great source of reference for developers for migrating applications to open source technologies such as HTML5, Node.js, and MySQL. Who This Book Is For
This book will prove to be a "must have" for beginners as well as experienced professionals as it is a stepping stone for learning new technology. Table of Contents
1. Introduction to Node.js
2. Modules in Node.js
3. File system module
4. NPM in node.js
5. Event handling in Node.js
6. Node.js with MySQL
7. Express and Node.js About the Author
Dhruti Shah is a multi-skilled, tech savvy person with more than 12 years of experience as a software trainer, technical writer, project lead and manager in the field of education and training in Information Technology. She holds a Master of Computer Applications (MCA) degree from South Gujarat University. She is a Microsoft Certified Training Specialist and has trained more than 2000 candidates world-wide on more than 10 technologies. With a keen sense of technological advancement, she has self-acquired working knowledge of several technologies including Java, .NET, PHP, Linux, SQL Server, MySQL, Node.js and so on. She has authored books on these technologies for educational institutions and also conducted webinars on technical subjects for international clients like Nigeria, Vietnam, and Trinidad. She has been appreciated as a model representative for India for flawlessly managing two prestigious International projects to set up and upgrade the Centre of Excellence in Information Technology in Panama and Costa Rica, Central America (a collaboration project of Indian government with the governments of Panama and Costa Rica).

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Node.JS Guidebook est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Node.JS Guidebook par Dhruti Shah en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Computer Science et Programming in JavaScript. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2018
ISBN
9789387284432

SECTION 1

■ ■ ■

Introduction to Node.js

Session Objectives

  • Understand the concept behind Node.js.
  • Understand the features of Node.js.
  • Learn to work with Node.js REPL terminal.
  • Learn to use Node.js with Command Line Interface.
  • Learn to use Node.js with an Integrated Development Environment (IDE).
  • Compare Node.js with other JavaScript based technologies.

1.1 Introduction

Node.js is an open-source framework based on JavaScript. It was developed by Ryan Dahl in 2009. It is designed from the JavaScript V8 Engine of Google Chrome. Node.js was released under the MIT Licence. It is freely available and its codes are written in JavaScript that work on several platforms such as Windows, Mac OS X, Linux, etc.
[Note: Massachusetts Institute of Technology (MIT) License is a permissive free software license. It puts very limited restrictions on reuse and also provides better license compatibility.]
Normally, JavaScript only runs in the browser but cannot run on the machine. Node.js allows the JavaScript to run on the machine. This allows access to the file system and listen to network traffic on the machine. Also, it can handle HTTP requests like a Web server and send back responses including files. It can directly access databases from JavaScript. In short, anything which can be done with PHP or ASP can now be done by using JavaScript. That is, Node.js uses JavaScript on the server.

1.1.1 Features and Benefits of Node.js

  1. It provides a cross-platform runtime environment as well as a JavaScript library.
  2. It is lightweight and very useful for data-intensive applications that work real-time and across several devices. This is because, Node.js uses an event-driven, single-threaded, non-blocking I/O model which is very memory efficient.
  3. It uses asynchronous programming methodology in which the server does not have to wait for the first request to complete in order to handle another request.
  4. Node.js library executes the code very quickly as it is built on the V8 JavaScript Engine of Google Chrome
  5. Unlike other servers, Node.js does not support buffering of data. The data is displayed in chunks.
  6. Node.js can read, write, create, open and close files on a server.
  7. It can also create, add, update, and delete data from databases.
  8. Node.js can generate dynamic page content and collect form data from a Web page
  9. Node.js uses a single-thread model with event looping so that the applications work in a non-blocking manner and become highly scalable. Due to event-looping mechanism, a single thread can handle more number of requests as compared to existing servers such as HTTP server, Apache server, etc.
[Note: Scalability of an application is measured on the basis of the number of user requests a server can handle. Highly scalable application means it can handle lot of user requests at a time]
Following figure depicts some important parts of Node.js:
Figure 1.1: Parts of Node.js

1.1.2 Types of Applications that can be Developed Using Node.js

Node.js can be used to develop a variety of applications including:
  • Web and networking applications.
  • Video streaming sites which are I/O intensive Web applications.
  • Single-page applications.
  • Data Intensive Real-time Applications (DIRT).
  • JSON APIs based Applications.

1.1.3 Asynchronous Programming with Node.js

Normally, when a request is sent to a Web server for fetching data or files, technologies such as PHP or ASP would handle it by sending the request to the server. However, until the server does not open, read and return the data or file content to the client, it cannot handle another request. Only after the first request is completed, the next request is addressed.
However, Node.js follows the asynchronous methodology. Here, the request is sent to the server or the computer’s file system first. While the server opens, reads and returns the data to the client, at the same time the next request is handled by Node.js. In short, the waiting time is eliminated and the application can serve multiple requests at a time.

1.2 Set up the Node.js Environment

For using Node.js, download and install the latest version of Node.js from the official page https://nodejs.org
To install Node.js, double-click the Windows Installer MSI file and follow the instructions of...

Table des matiĂšres