Home » NodeJs

Start writing Unit Test of mongoose model using Test Jest

Get Started Install Jest using yarn: yarn add –dev jest npm: npm install –save-dev jest More detail about jest https://jestjs.io/docs/en/getting-started   we need mongodb-memory-server-core package.  This package spins up a actual/real MongoDB Server programmatically from node for testing or mocking…

Read More »

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 »

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 »

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 »