the Power of Node.js Name: Bakr Albakr ID: 421101917 Dr. Khalid Nazim Department of Computer Science.
TABLE OF CONTENTS
Introduction to Node.js Node.js is an open-source, cross-platform JavaScript runtime environment that executes JavaScript code outside of a web browser. Initial Release: May 27, 2009 Creator: Ryan Dahl Built on Chrome's V8 JavaScript engine Node.js is written in C, C++, and JavaScript.
Components of the Node.js Architecture Requests: Depending on the actions that a user needs to perform Node.js Server: The Node.js server accepts user requests, processes them, and returns results to the users. Event Queue: The main use is to store the incoming client requests and pass them sequentially to the Event Loop. Thread Pool: contains the threads that are available for performing operations required to process requests. Event Loop: Event Loop receives requests from the Event Queue and sends out the responses to the clients. External Resources: To handle blocking client requests, external resources are used.
Application of Node.js
Features of Node.js Easy to use: Node.JS is easy to understand and quick, to begin with. Speed: With a non-blocking mechanism in the single-threaded environment sued by Node.JS, the framework is pretty fast and efficient. Packages: Node.JS is an open-source framework. This allows developers to access more than a million packages from the NPM ecosystem. Multi-Platform: The framework allows you to leverage cross-platform support to build SaaS websites, mobile apps and even website apps.
Popular Frameworks , Libraries
To create a React app n px create-react-app my-react-app To Run the React Application cd my-react-app npm start The result: function Welcome() { return <h1>Hello React!</h1>; } ReactDOM.render (<Welcome />, document.getElementById ( 'root' )); This example creates a react component named “welcome “
NPM is the default package manager for JavaScript's runtime Node.js. NPM consists of two main parts: a CLI (command-line interface) tool for publishing and downloading packages, and an online repository that hosts JavaScript packages