Skip to main content

Posts

Showing posts from May, 2020

4. Install Nodejs - Beginner Level

Step 1: Download the Node.js .msi Installer As the first step to installing Node.js on Windows, you'll need to download the installer. You'll be able to grab the installer from the  official downloads page for Node.js . You'll be able to download the Windows Node.js installer by clicking the Windows Installer option at the top of the page - when you click this, you'll get an MSI installer download. Make sure to save it somewhere that you'll be able to find it! Step 2: Run the Node.js Installer You've got the Windows Installer - great! Now, you need to install it on your PC. The installer is a pretty typical Wizard interface for installing software on Windows - there are a few steps to it, but you can have it done in under a minute. You can get through it by following the guide below: You've got the Windows Installer - great! Now, you need to install it on your PC. The installer is a pretty typical Wizard interface for installing software on Windows - there a...

3. Nodejs REPL - Beginner Level

What is REPL? A Read-Eval-Print Loop (REPL) is a simple, interactive computer programming environment. The term 'REPL' is usually used to refer to a LISP interactive environment but can be applied to command line shells and similar environments for programming languages like Python, Ruby etc. In this tutorial, we have discussed REPL with respect to Node.js. In a REPL environment, an user can enter one and more expressions, which are then evaluated (bypassing the compile stage), and the result displayed. There are 4 components to a REPL (comes from the names of the Lisp primitive functions ) : A  r ead function, which accepts an expression from the user and parses it into a data structure in memory . An  e val function, which takes the data structure and evaluates. A  p rint function, which prints the result. A  l oop function, which runs the above three commands until termination Node.js ships with a REPL. If you start the Node.js binary without ...

2. Nodejs Basic Concepts - Beginner Level

What is Non-Blocking IO in Nodejs? To understand this concept we'll first understart the concept of synchronous execution which is sort of how traditionally PHP would work. So imagine we have a program that has to fetch some names from a database and print them out onto the console along with the string Hello users. When we run this program the first line gets executed and in walks a method called Get users which runs a query on a database for now imagine that this was written using our traditionally synchronous language such as PHP. The interesting thing to note here is that the database query in this case would effectively block and hold up execution of the remaining script since it would need some time to query and fetch the data as desired. So the result is not received from the database. The rest of the script that is the last print statement that is supposed to output Hello users is blocked and not executed once the result is received back from the database. The result of...

1. Introduction to Nodejs - Beginner Level

What is Nodejs  Nodejs is an incredible platform for building high performance web applications. You write your code in javascript perhaps the world's most popular programming language. Nodejs it was created by  Ryan Dahl  back in 2009. Its early development and maintenance was sponsored by Joyent. IOjs really helped accelerate the development of this platform and to an extent that in early 2015 the Nodejs foundation was announced with key members such as IBM, Intel, Microsoft and more. Soon after in mid-2015 both the IOjs and Nodejs communities wanted to join hands and merge the projects to work under the Nodejs Foundation. The first official release of not just after its merger with IOjs has been version 4.x. Unlike other programming languages such as PHP  Nodejs is a platform . This means that you are given the ability to write code that gives you full control over your app logic and the environment within which it has to operate. You effectively write your apps f...

Nodejs Interview Questions Answers

What Is Node.js? Node.js is a powerful framework developed on  Chrome’s V8 JavaScript engine  that compiles the JavaScript directly into the native machine code. It is a lightweight framework used for creating server-side web applications and extends JavaScript API to offer usual server-side functionalities. It is generally used for large-scale application development, especially for video streaming sites, single page application, and other web applications. Differentiate between JavaScript and Node.js? Features JavaScript Node.js Type Programming Language Interpreter and environment for JavaScript  Utility Used for any client-side activity for a web application Used for accessing or performing any non-blocking operation of any operating system Running Engine Spider monkey (FireFox), JavaScript Core (Safari), V8 (Google Chrome), etc. V8 (Google Chrome) List down the major benefits of using Node.js? Features Description Fast Node.js is b...