Kinda Code
Home/Node/Page 2

Node

Node.js tutorials, tips & tricks
Node.js: Use Async Imports (Dynamic Imports) with ES Modules

Node.js: Use Async Imports (Dynamic Imports) with ES Modules

Updated: Feb 12, 2023
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......
Node.js: Reading and Parsing Excel (XLSX) Files

Node.js: Reading and Parsing Excel (XLSX) Files

Updated: Feb 12, 2023
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......
How to Install Node.js on Ubuntu 20.x/21.x/22.x

How to Install Node.js on Ubuntu 20.x/21.x/22.x

Updated: Oct 04, 2022
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......
Cascade Delete in TypeORM

Cascade Delete in TypeORM

Updated: Sep 27, 2022
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......
Node.js + Express + TypeScript: req.query type

Node.js + Express + TypeScript: req.query type

Updated: Sep 14, 2022
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......
Node.js Error: listen EADDRINUSE: Address already in use

Node.js Error: listen EADDRINUSE: Address already in use

Updated: Sep 14, 2022
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:......
Nodemon: Automatically Restart a Node.js App on Crash

Nodemon: Automatically Restart a Node.js App on Crash

Updated: Sep 13, 2022
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......
Node.js: Turn a Relative Path into an Absolute Path

Node.js: Turn a Relative Path into an Absolute Path

Updated: Sep 01, 2022
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') //......
TypeORM: Find Rows Where Column Value is IN an Array

TypeORM: Find Rows Where Column Value is IN an Array

Updated: Aug 31, 2022
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......
How to Store JSON Object with TypeORM

How to Store JSON Object with TypeORM

Updated: Aug 31, 2022
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......
TypeORM: Add Columns with Array Data Type

TypeORM: Add Columns with Array Data Type

Updated: Aug 31, 2022
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......
TypeORM: Property ‘id’ has no initializer and is not definitely assigned in the constructor

TypeORM: Property ‘id’ has no initializer and is not definitely assigned in the constructor

Updated: Aug 20, 2022
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......