аvascript is without a question among the most prominent and commonly used client-side programming languages available. jаvascript's scope of use has expanded in recent years, and it is now also used for server-side development. Node.js is an extremely popular JS framework, meant for rapid web and application development.
Conquering jаvascript: Node.js helps the reader master the Node.js framework for faster and more robust development. This book is a detailed guide that will help developers and coders do more with Node.js. It discusses the basics in brief, and then moves on to more advanced and detailed exercises to help readers quickly gain the required knowledge.
jаvascript is used to write the source code in the source file. Your jаvascript code will be interpreted and executed using the Node.js interpreter. The Node.js distribution supports SunOS, Linux, Mac OS X, and Windows operating systems with 32-bit (386) and 64-bit (amd64) x86 CPU architectures.
The most compelling feature of Node.js is how easy it is for programmers to scale apps horizontally as well as vertically. By adding a few more new nodes to the existing system, the applications can be horizontally scaled. Furthermore, Node.js allows you to add extra resources to single nodes during the vertical scaling of the application. As a result, it’s extremely scalable and a superior option to existing jаvascript servers.
Key Features:
- Discusses how to use Node.js for real-world practical solutions
- Provides complete coverage of full-stack development
- Covers server-side development with Node.js
This book is a valuable reference for Node.js developers as well as those involved in game development, mobile apps, progressive applications, and now even desktop apps.
Author(s): Sufyan bin Uzayr
Publisher: CRC Press
Year: 2023
Language: English
Pages: 188
Cover
Half Title
Series Page
Title Page
Copyright Page
Dedication
Contents
About the Editor
Acknowledgments
Zeba Academy – Conquering JavaScript
CHAPTER 1: Introduction
ENVIRONMENT SETUP FOR NODE.JS
Setup of the Local Environment
Editor of Text
The Runtime for Node.js
The Node.js Archive Can Be Downloaded Here
UNIX/LINUX/MAC OS X AND SUNOS INSTALLATIONS
Windows Installation
Node.js Has a Number of Features
Who Makes Use of Node.js?
When Should You Use Node.js?
THE BENEFITS OF NODE.JS
Scalability Is Straightforward with Node.js
Simple to Comprehend
The Computer Language Node.js Is Used as a Single Programming Language
Full-Stack JS Node’s Advantages
Recognized for Delivering Exceptional Results
A Large and Active Group Node Provides Community Support
The Advantages of Caching
Allows You to Build Own Applications
Handles a Large Number of Requests at Once
Node.js Is a Framework with a Lot of Flexibility
DISADVANTAGES OF NODE.JS
API Instability: Significant Code Changes as a Result of Unstable API
Your Code May Be Jeopardized If You Do Not Have a Library Support System
Code That Is Difficult to Maintain
When Performing Heavy Computing Tasks, Performance Is Reduced
CORE CONCEPT
There Are a Lot of Libraries
A BRIEF OVERVIEW OF NODE.JS’S HISTORY
How to Install Node.js
To Use Node.js, How Much JavaScript Do You Need to Know?
NODE.JS AND THE BROWSER: WHAT’S THE DIFFERENCE?
The Ecosystem Is What Changes
WEB APPLICATION ARCHITECTURE WITH NODE.JS
Node.js Server Architecture
Asynchronous Model
Avoid Using Synchronous Functions and Instead Use Asynchronous Ones
Callbacks
Emitters of Events
There’s a Catch with Asynchronous Code
Nonblocking I/O Operations
Callbacks
IS NODE.JS A FRONTEND OR A BACKEND FRAMEWORK?
WHEN SHOULD NODE.JS BE USED?
FRAMEWORKS FOR NODE.JS AND ITS VARIOUS FORMS
MVC (Model View Controller) Framework
MVC Frameworks That Cover the Entire Stack
Frameworks for REST APIs
Express.js
Koa.js
Socket.io
Hapi.js
HOW DOES ONE PICK A NODE.JS HOSTING SERVICE?
Amazon Web Services
Google Cloud Platform
Heroku
Microsoft Azure
RedHat OpenShift Online
ZEIT
DigitalOcean
THE V8 JAVASCRIPT ENGINE
Other JS Frameworks
The Pursuit of Excellence
Compilation
Use the Command Line to Run Node.js Programs
Automatically Restart the ApplicationWhen
WHAT IS THE BEST WAY TO END A NODE.JS PROGRAM?
RECAP OF BASICS
SUMMARY
NOTES
CHAPTER 2: Application Development I
BUILDING APPLICATION WITH NODE.JS
What Are WebSockets and How Do I Use Them?
Definition of WebSockets
What Are WebSockets and How Do They Work?
REQUIREMENTS
IN NODE.JS, HOW DO YOU MAKE A WEBSOCKETS API?
UndeRESTimated
Single Point of Failure (at the Point of Entry)
As a Contract, the Message
Internal Communication
HTTP versus WebSockets
Building a Chat Room App with Socket.io Tutorial
CODE TUTORIAL
WHAT SOCKET.IO IS NOT?
You Must Now Prepare the Frontend Portion
SUMMARY
CHAPTER 3: Application Development II
STEP 1: PERFORM A MARKET STUDY
Music Streaming Apps
eSports Streaming Apps
STEP 2: IDENTIFYING CHARACTERISTICS
Basic Characteristics
Optional Extras
STEP 3: COMPLETION OF THE TECH STACK
Protocols for Online Video Streaming
MPEG-DASH
HLS
RTMP
WebRTC
PLATFORMS FOR STREAMING
CONTENT DISTRIBUTION NETWORKS
Database and Hosting
STEP 4: DEVELOPMENT AND DESIGN
STEP 5: TESTING AND UPKEEP
WHAT DOES IT COST TO CREATE A STREAMING APPLICATION?
Costs Dependent on Features
APPLICATION DEVELOPMENT USING NODE.JS
Streams for Video Games
What Exactly Are Streams?
A Real-Life Example
Iterator in Asynchronous Fashion
Reading Modes
What Is the Most Effective Method for Creating a Writable Stream?
Pipeline ()
The Stream Module
Node APIs with Streams
OVERVIEW OF THE PROJECT
Advantages and Disadvantages of the Application
CODE TUTORIAL
The /Video Endpoint
Identifying the Range
Creating Headers for Responses
SUMMARY
CHAPTER 4: Application Development III
WHY IS NODE.JS THE BEST IOT SOLUTION?
WHAT EXACTLY ARE THE ADVANTAGES OF NODE.JS FOR IOT?
Application Development Using Node.js
IoT Protocols Are Simple to Integrate with Node.js
Node.js Is a Powerful and Quick Programming Language
Node.js Is a Scalable and Resource-Efficient Programming Language
Data Security Is Provided by Node.js
Authentication That Is Safe
It’s Easy to Create APIs with Node.js
Where Can I Begin Developing an IoT Project in Node.js?
How Do You Pick the Best Database for IoT?
How to Make Big Data Work for IoT Projects
The Project’s Future Architecture Will Be Able to Grow with It
The Work with the Project’s Code Is the Next Step in Optimization
Real-Time IoT Analytics
What Are Some Examples of Node.js-Based IoT Apps?
Uber
Code Tutorial
The Schema’s Design
Geospatial Indexes in MongoDB
SUMMARY
CHAPTER 5: Code Optimization
WHAT MAKES NODE.JS PERFORMANCE SO SPECIAL?
Run-to-Completion, Single-Threaded Behavior
Detecting Memory Leaks
WHAT IS AN EVENT LOOP AND HOW DOES IT WORK?
THE EVENT LOOP AND NODE.JS PERFORMANCE
Setting Up, Running, and Analyzing a Performance Test for Node.js Application
Creating a Performance Test Profile in Node.js
Duplicating Large-Scale Distributed Systems
Configuring Our Monitoring
Setting Up a Node.js Performance Test Environment
Running Our Tests
How to Make Node.js Run Faster
Tooling for the Frontend
Task Runners and Module Bundlers
Modules and Preprocessors for CSS
Images
HTTP/2 and SSL/TLS
Using Caching
Improving Data Management Techniques
WHAT IS THE MOST EFFICIENT WAY TO ACHIEVE THIS?
Load Balancing
Client-Side Authentication That Is Secure
Maintaining a Lightweight and Compact Code
Effective Server Communication with WebSockets
Coding That Is Asynchronous
Synchronous
Asynchronous
Query Augmentation
OVERVIEW OF BASIC STRATEGIES FOR IMPROVING DATABASE PERFORMANCE/OPTIMIZATION
SELECT Should Be Avoided at All Costs
Use the WHERE Clause
To Sample the Query Results, Use LIMIT
Avoid CHOOSE A UNIQUE OPTION
Use the Wildcard (Percent) Character as Needed
Using Off-Peak Hours to Run Queries
GO WITHOUT A SESSION
Tracing and Logging of Scripts
Winston
Morgan
Bunyan
Parallelism
NODE.JS ENCRYPTION GUIDELINES
Why Are There Security Issues with Node.js?
TOP NODE.JS SECURITY CONCERNS AND RECOMMENDATIONS
Validate User Inputs to Limit XSS Attacks
Data Leaks Should Be Avoided at All Costs
Make Use of Security Linters
Each Request Should Have Access Control Implemented
Deserialization Using Encryption
HTTP Response Headers Are Executed
Create a Logging and Monitoring System
Authentication Should Be Strong and Thorough
Scan Apps for Vulnerabilities on a Regular Basis
Build Pipelines for Security Patches Using Fluid
GENERAL TIPS
Look at Our Naming Conventions
Where Functions Should Be Modularized
Commenting in the Right Way
When Debugging, Be Aware of the Context
Destructuring
Do Not Make the Same Mistake Twice
Callback Etiquette
ALWAYS DOUBLE-CHECK CALLBACKS FOR PROBLEMS
On Callbacks, Return
Only Use Try-Catch in Sync Code
As Much as Possible Keep Away from It
Make Effective Use of Async Patterns
ERROR CORRECTION
Errors in Operations
Taking Care of Operational Errors
Errors in Programming
Referred to as an Async
Taking Care of Programmer Faults
SUMMARY
NOTES
CHAPTER 6: Summary
CAREER PROSPECTS OF NODE.JS
USING NODE.JS WITH OTHER FRAMEWORKS AND TOOLS
WHAT ARE THE ADVANTAGES OF UTILIZING NODE.JS FRAMEWORKS?
JS Frameworks and Their Types
FRAMEWORKS FOR WEB APP DEVELOPMENT USING NODE.JS
Loopback
Adonis
Total
HOW DO WE PICK THE BEST FRAMEWORK FOR OUR WEB APPS?
IS NODE.JS COMPATIBLE WITH REACT?
WHY USE NODE.JS AND REACT TOGETHER FOR WEB APP DEVELOPMENT?
HOW TO CREATE AN ANGULAR APP USING NODE.JS
Introduction
Prerequisites
Project Exercising
Phase of Development
Structure of the Project
API for Node.js
ANGULAR APPLICATION
The Angular and Node APIs Work Together
How to Create a Production-Ready Project
SUMMARY
BIBLIOGRAPHY
INDEX