Home » JavaScript

TypeORM

What is TypeORM TypeORM (object-relations-management ) is a tools and it is used with TypeScript. I am going to use Ts.ED and database PostgreSQL So, this article will helpful who are going to useTs.ED. In this post we’ll learn about…

Read More »

Kick start graphQL

What is GraphQL GraphQL is query language which is designed to operate over a single end point via HTTP with optimize for performance and flexibility. Why we need GraphQL Actually, it helps to address some of the more…

Read More »

Passport.js Authentication

What is middleware Authentication and why it is important? Middleware Authentication is the technique used to ensure that the managing server and data collectors communicate with each other in a secure manner. lets give a simple example: suppose…

Read More »

Web Storage concepts and usage

What is Web Storage Web storage is known as DOM(Document Object Model) storage. It provides web application software method and protocols used for storing data in a web browser similar to cookies. But it has greatly enhanced capacity…

Read More »

Promises and Error Handling

What is promise? Promise provide us an alternative approach of asynchronous operation which is clean, more readable and flexible when compared to traditional callback-based approaches. It is very useful when we chain multiple async operation and after that we do…

Read More »

Git cheat sheet and practical uses

This cheat sheet summarizes commonly used Git command line instructions for quick reference Story 1:  What will we do when we have to work on a new features/ new work? First, we need to checkout master branch “$git…

Read More »

Tips to Add Tooltip to Select2

How to add tooltip in select2 When selected text is long in select2, then it does not show the full text. So, it is very difficult to understand what is selected. For the above problem we can solve…

Read More »

Temporal dead zone (TDZ) and the Deathly Hallows

What is TDZ in javascript? Temporal dead zone is the period between entering scope and being declared where they cannot be accessed. An example will give it clear the concept of TDZ. So, for example- accessDenied = ‘can not…

Read More »

Circular dependencies in Node.js

What is cyclic/ circulardependencies in nodeJs When required a module and we got {} instead. Suppose, we have the following code // moduleA.js var ModuleB = require(‘./moduleB.js’); var ModuleA = function() { this.bInstance = ModuleB(); this.property = 10;…

Read More »

Using Sinon to stub Mongoose calls and return Promise

Suppose we have a schema var User = require(‘./schemas/UserSchema’).User; and we want to write unit test for like bellow code: var getUserById = function () { return User.findOne({_id: ‘001’}).exec(); }; Before writing unit test we can mock the…

Read More »