Repository Pattern in JavaScript

The Repository Pattern is a structural pattern that abstracts and centralizes data access operations, providing a consistent and simplified interface for the application to interact with data sources. In essence, the Repository Pattern acts as a mediator or a middleman between the application’s business logic and the data storage, shielding the rest of the code…

Automatically Log or Append Data to Express Response

Sometimes you need to log Express response in order to see what your application responded with. Doing it for each route can be tedious. A better approach is to use a middleware. The middleware also gives you the flexibility to choose responses from which routes to log. When you have access to your response in…

How to Configure ESLint with Prettier in React Project

Install ESLint and Prettier Many modern JavaScript Projects use ESLint with Prettier setup. While ESLint keeps the style in good shape, Prettier is used to autoformate the code. In this article we will show our approach to setting up a React project with ESLint and Prettier (AirBnB). Let’s create a project and name it eslint-prettier-airbnb…