Overview Nowadays, many modern Node.js applications use ES modules (that go with the import keyword) instead of CommonJS modules (that go with the require keyword). When working with ES modules, there might be scenarios where you......
This article shows you how to read and extract content from an Excel (.xlsx) file by using Node.js. Without any further ado, let’s get our hands dirty and start coding. Getting Things Ready We are going to work with a......
This article shows you how to install Node.js and NPM on Ubuntu 20.04 (Focal Fossa), Ubuntu 20.10 (Groovy Gorilla), Ubuntu 21.04 (Hirsute Hippo), Ubuntu 21.10 (Impish Indri), Ubuntu 22.04 (Jammy Jellyfish), and Ubuntu 22.10 (Kinetic......
When working with a database, the cascade delete feature ensures that deleting a parent record will also remove the child records. For instance, we have a table that stores information about users and another table that stores......
When working with Node and Express.js, there might be cases where you need to access req.query, an object that contains the property for each query string parameter in the route. For example, given a route like......
This quick article shows you how to solve a common error you might confront when working with Node.js. The Problem When developing a Node.js application (with Express.js), I sometimes fall into the following problem: Error:......
A large number of developers use Nodemon during the development and testing of Node.js apps. When your code file changes, Nodemon will automatically restart the program. However, when the app crashes, it will stop: nodemon app......
In Node.js, you can convert a relative path to an absolute path simply by using the path module, like this: import path from 'path' // if you're using commonJS, use "require" instead of "import": // const path = require('path') //......
This short and straight-to-the-point article shows you 2 different ways to use the WHERE IN query in TypeORM (in case you want to search for rows whose column values are an element of a given array). The first approach is to use the......
If you want to store some kind of flexible data with TypeORM, you can save them as JSON. You can specify the column type as simple-json. This helps you store and load Javascript objects with ease. Let’s examine a concrete......
When using TypeORM, it’s possible to define columns with the array data type. If you want to add a column that stores arrays of numbers, you can define it like so: @Column('integer', { array: true, // this is supported......
When defining entities with TypeORM and TypeScript, you may encounter an annoying issue as follows: Property 'id' has no initializer and is not definitely assigned in the constructor The warnings are present not only in the id field......