Node Tutorials

Node.js MongoDB Query: With Sorting and Projection

Unlike MySQL, where a query can perform various operations like creating tables, inserting records, deleting records, etc, in MongoDB we have separate functions for these such as createCollection(), insertOne(), insertMany(), deleteOne(), and deleteMany(). Queries in MongoDB do not handle such tasks. So what does it do? Queries in MongoDB are used to filter the result […]

Node.js MongoDB Query: With Sorting and Projection Read More »

Parsing HTML in Node.js with node-html-parser

HTML (Hypertext Markup Language) is used to construct web pages and define their structure and components through various elements and tags. In Node.js, the npm node-html-parser module provides a powerful tool for HTML parsing. It simplifies interaction with HTML and lets us do tasks like data extraction, web scraping, content manipulation, etc. In this article,

Parsing HTML in Node.js with node-html-parser Read More »

Making HTTP Requests in Node.js With node-fetch

When developing web applications, we don’t actually build everything from scratch. We may sometimes want to “outsource” certain tasks. For this, we can use APIs from other websites that offer services that we integrate into our application without lifting a finger! To achieve this, we can use the built-in window.fetch() when using plain vanilla JavaScript.

Making HTTP Requests in Node.js With node-fetch Read More »

NodeJS MongoDB Find: Querying Single and Multiple Documents

A MongoDB database can have multiple collections, which can contain lots of documents. To find documents based on custom queries, the MongoDB Node.js driver provides us with two useful methods: find() and findOne(). Let’s see them in detail. How to Query MongoDB Documents in Node.js MongoDB database is implemented in NodeJS using the MongoDB module,

NodeJS MongoDB Find: Querying Single and Multiple Documents Read More »

Node.js Readline Module: Get User Input From Command Line

Readline Module is a built-in module in Node.js used for handling user inputs and providing resultant output to the command line. This module offers various methods to help interact with CLI. Using this tool we can create a fully functional CLI-based application. Let’s learn it in detail. Introduction to Node.js Readline The Readline Module is

Node.js Readline Module: Get User Input From Command Line Read More »