Ways to implement Proxy Pattern in Node.js

Sometimes we may want to access indirectly to an object, via a substitute. That substitute is called Proxy. The Proxy Pattern helps us deal with a proxy object and talk to the actual object. In this tutorial, we’re gonna look at 2 ways to implement Proxy Pattern in Node.js:

  • Using custom Proxy Class
  • Using Proxy API

[Continue reading…] “Ways to implement Proxy Pattern in Node.js”

How to implement Dependency Injection in Node.js with Example

Dependency Injection is one form of Inversion of Control technique that supports the Dependency Inversion principle (the last one of SOLID Principles – decoupling software modules). In this tutorial, we’re gonna look at way to implement Dependency Injection pattern in Node.js.

[Continue reading…] “How to implement Dependency Injection in Node.js with Example”

How to implement Builder Pattern in Node.js

When we want to create complicated object which has multiple parts, we can use Builder Pattern that separates the building of these parts. This creational process does not care about how these parts are assembled.

In this tutorial, we’re gonna look at 2 ways to implement Builder Pattern in Node.js:

  • using Builder function
  • using Builder class

[Continue reading…] “How to implement Builder Pattern in Node.js”

How to implement simple Factory Pattern in Node.js

Instead of using class constructors or new keyword to create an object of a class, we can abstract this process. So, we can determine the type of object at run-time, by the time of generating that class object. The implementation seems like Factory Method, but simpler than Factory Method. This simple Factory is not treated as a standard GoF design pattern, but the approach is common to any place where we want to separate the code that varies a lot from the code that does not vary.

In this tutorial, grokonez shows you how to do it in NodeJs.

[Continue reading…] “How to implement simple Factory Pattern in Node.js”

How to implement Singleton in Node.js

Singleton is object that can have only a single, unique instance, with a single point of access. Node.js module system provides simple way to implement Singleton using module.exports. Module will be cached when it is accessed using require() statement. So our module is merely a cached instance although it behaves like a Singleton.

In this tutorial, we’re gonna look at ways to implement this kind of Singleton in Node.js:

  • Singleton Object
  • Singleton Class

[Continue reading…] “How to implement Singleton in Node.js”

Excel File/Data – Nodejs Express RestAPI – Download/Extract Excel(.xlsx) Data/File from MySQL

In the tutorial, Grokonez shows how to download & extract Excel(.xlsx) File/Data from MySQL with Nodejs Express and exceljs lib.

Related posts:
Node.js Extract MySQL Data to Excel(.xlsx) File – using exceljs

[Continue reading…] “Excel File/Data – Nodejs Express RestAPI – Download/Extract Excel(.xlsx) Data/File from MySQL”

CSV File/Data – Nodejs Express RestAPI – Download/Extract CSV Data/File from MySQL

In the tutorial, Grokonez shows how to download & extract CSV File/Data from MySQL with Nodejs Express and json2csv lib.

Related posts:
Node.js Extract MySQL Data to CSV File – using Json2Csv

[Continue reading…] “CSV File/Data – Nodejs Express RestAPI – Download/Extract CSV Data/File from MySQL”

Nodejs Express RestAPI – Upload/Import Excel file/data to MongoDB – using Convert-Excel-to-Json + Multer

In the tutorial, Grokonez shows how to upload & import Excel File/Data to MongoDB using convert-excel-to-json and multer libs.

Related posts:
Node.js Import Excel File to MongoDB – using Convert-Excel-To-Json lib

[Continue reading…] “Nodejs Express RestAPI – Upload/Import Excel file/data to MongoDB – using Convert-Excel-to-Json + Multer”

Nodejs Express RestAPI – Upload/Import CSV file/data to MongoDB – using CsvToJson + Multer

In the tutoria, Grokonez shows how to upload & import CSV File/Data to MongoDB using csvtojson and multer libs.

Related posts:
Node.js Import CSV File to MongoDB – using CsvToJSON

[Continue reading…] “Nodejs Express RestAPI – Upload/Import CSV file/data to MongoDB – using CsvToJson + Multer”

Nodejs Express RestAPI – Upload/Import Excel File to MySQL – using Read-Excel-File & Multer

In the tutorial, Grokonez shows how to upload & import Excel File/Data to MySQL using read-excel-file and multer libs.

Related post:
Node.js Import Excel File to MySQL – using Read-Excel-File lib

[Continue reading…] “Nodejs Express RestAPI – Upload/Import Excel File to MySQL – using Read-Excel-File & Multer”

Nodejs Express RestAPI – Upload/Import CSV File to MySQL – using Fast-CSV & Multer

In the tutorial, Grokonez shows how to upload & import CSV File/Data to MySQL using fast-csv and multer libs.

Related post:
Node.js Import CSV File to MySQL – using FastCSV

[Continue reading…] “Nodejs Express RestAPI – Upload/Import CSV File to MySQL – using Fast-CSV & Multer”