Home » JavaScript (page 2)

JavaScript

Caching of Modules in NodeJS

In this post, I am talking about caching of Modules in NodeJS. We have the following files 1 2 3 4 5 6 7 //greet.js module.exports = {     greeting: "Hello!",     greet: function(){         console.log(this.greeting);     } } 01 02 03 04 05 06 07 08 09 10 //app.js var greet1 = require("./module/greet"); greet1.greet(); greet1.greeting = "Yooo!"; greet1.greet();       var greet2 ...

Read More »

Exports vs module.exports in NodeJs, Which one to use?

We know that when our code is run through the node it’s wrapped in a function expression. This enables us to access the module object which is a parameter passed to that function. 1 2 3 (function (exports, require, module, __filename, __dirname) {     //module code }); This function expression is then invoked with the following arguments: 1 fn(module.exports, require, module, ...

Read More »

How NodeJs Processes Modules?

We all know that to execute a node application, we have to type the command. In this post, we’ll see how NodeJS processes Modules. whereapp.jsis the entry point to our application. But seldom do we wonder about what’s happening when we type this command. How does the node magically come to take our js file and executes it? This is ...

Read More »

V8 Engine and Introduction to NodeJS

Sharing is Caring This post is going to talk about V8 Engine and Introduction to NodeJS Processor Accepts instructions in a particular language (eg: IA-32, X86-64, ARM, MIPS…). We need to give instruction to a processor on a computer in the language it understands. The microprocessor inputs those instructions and executes them. Machine Code (or Machine Language) Programming languages understood ...

Read More »

19 Best Practices For Automation testing With Node.js

Node js has become one of the most popular frameworks in JavaScript today. Used by millions of developers, to develop thousands of project, node js is being extensively used. The more you develop, the better the testing you require to have a smooth, seamless application. This article shares the best practices for the testing node.in 2019, to deliver a robust ...

Read More »

JavaScript Array Iteration Methods Example

Greetings readers, in this tutorial, we will explore the Array iteration methods in the javascript. 1. Introduction JavaScript is an object-oriented programming language that allows the client-side scripting to interact with a user and deliver the dynamic pages. Most web browsers including Google Chrome, Mozilla Firefox, Safari, Internet Explorer, Microsoft Edge, Opera, etc. support it. The JavaScript scripting language includes: ...

Read More »

JavaScript Number Methods and Properties Example

Greetings readers, in this tutorial, we will explore the Number methods and properties in the javascript. 1. Introduction JavaScript is an object-oriented programming language that allows the client-side scripting to interact with a user and deliver the dynamic pages. Most web browsers including Google Chrome, Mozilla Firefox, Safari, Internet Explorer, Microsoft Edge, Opera, etc. support it. The JavaScript scripting language ...

Read More »

Using Node 11.7 Worker Threads with RxJS Observable

With the release of Node 11.7, the worker_threads module becomes a standard feature and is no longer hidden behind the --experimental-worker switch. The worker_threads module allows developers to run JavaScript asynchronously in light-weight, isolated threads contained within the main Node process. This article will be focusing on how use worker threads to execute a task asynchronously and stream data from ...

Read More »

JavaScript Arithmetic Operators Example

Greetings readers, in this tutorial, we will explore the arithmetic operators in the javascript. 1. Introduction JavaScript is an object-oriented programming language that allows the client-side scripting to interact with a user and deliver the dynamic pages. Most web browsers including Google Chrome, Mozilla Firefox, Safari, Internet Explorer, Microsoft Edge, Opera, etc. support it. The JavaScript scripting language includes: Declaring ...

Read More »