Compare two dates in JavaScript using moment.js

Moment.js is a great JavaScript library to work with date and time. If you’re looking for a solution to compare two dates in JavaScript, look no further than moment.js. It’s got great stock functions to help you play with date and time. Get current time To get the current time in moment.js you just call moment(). … Read more

Add an SVG file to your html in Angular

Images can be easily inserted at any section in an HTML page. To insert image in an HTML page, use the <img> tag. But, those days are gone. Img tag easily adds image of any format to your html page. You specify the path of the image and alternate text and you are done. <body> <img src=”/images/logo.png” … Read more

Get data from MongoDB in Cypress API testing

In this tutorial let’s see how you can get data from MongoDB and use the data when you test APIs with Cypress framework. Getting data from a database is not straightforward in Cypress as it basically runs the tests in a browser. Cypress allows to run backend node.js code in a separate files called plugins. A typical … Read more

Keep your Node.js app running in the background using PM2

Get started with the basics of PM2 and learn how to run your Node.js apps in the background using Node.js process manager PM2. PM2 is a daemon process manager that will help you manage and keep your Node.js application online 24/7. It’s a production grade process manager that let’s your node.js applications run in the background as microservices. PM2 … Read more

Remove unused npm modules from package.json

Depcheck is a tool for analyzing the dependencies in a project to see: how each dependency is used, which dependencies are useless, and which dependencies are unused from package.json. To identify the unused package, just run npx depcheck in the project root directory Next step is to uninstall the npm packages using npm uninstall command.