nodejs

Posts

Read Package.json file from Node.JS module

When you write a program you may want to read the content of the package.json file like what is the current package version. Here is one very simple way to read the content of this file.

Import a JSON file content from a Node.JS module

With the new Node.JS module it is possible to read the content of a JSON file with the import function but there is the right way to do it.

Configure yarn version for Cloudflare page build

With the new Cloudflare page build system, yarn package manager version can be more than version 1. But we can keep yarn version 1 configuring the build system with a package.json property.

Publish on Cloudflare Pages with unsupported language versions

It may happen that a version of Node is not supported yet by Cloudflare and will remain not supported for some weeks. That can happen even if it is a Long Term Support (LTS) version. Here how to build even if cloudflare does not support the version.

Extends Express session SessionData type

Express Session allows to store a lot of different data. There is a Typescript type named `SessionData` which allow to know what contains a session but not the data you will defined after without defining them.

Keep the same Node.js version between local environment and Github Actions

It can be complicated to have the same Node version between the local environment and the CI/CD. The latest Node.js version or the latest lts is released recently and if you want to upgrade to the Node version, usually you can forget to configure one environment.

Convert a JavaScript object to queryparams string

This post describes two very simple ways to convert a JavaScript object to a querystring both in a browser environment or server environment.

Update NodeJS with npm

New NodeJS releases are done often, so you need to keep your installation up to date. To do so, you can use your Linux distribution package manager (apt, dnf, ...) or brew for OSX. Another way is to use npm..