Showing a convenient way on how to use Secret Manager to securely pass sensible data as environment values to Google App Engine (GAE) services running with Node.js.
JavaScript
CommonJS vs. ESM/ECMAScript cheat-sheet
Short comparison of the most common statements in CommonJS vs. ESM/ECMAScript for importing, exporting and in your package.json.
Destructuring nested object properties in JavaScript
Quick tutorial on how to use destructuring for accessing nested JavaScript object properties.
Convert an existing NodeJS project from CommonJS to ESM / ECMAScript
A quick guide for converting your existing NodeJS projects from CommonJS to ESM/ECMAScript. Including Express, Jest, Supertest and ESLint.
Express: passing dates in an URL using route parameters including regex validation
Showing an elegant way on passing dates to your REST API’s and webservices using Express route parameters and regex validation standard features.
MongoDB: add/update fields referencing other existing fields using aggregation pipelines
Short explanation on how to add or update fields in documents referencing the values of other already existing fields by leveraging the aggregation pipeline framework.
Testing process.exit with Jest in NodeJS
Demonstrating a pragmatic way on how to test code paths resulting in process.exit
using the Jest test library.
JavaScript Map: sorted for-loop with a custom iterator
An elegant way of how to do a sorted iteration over all entries of a JavaScript Map with a for-loop using a custom iterator implemented with Symbol.iterator
, function*
and yield*
.
Use CommonJS npm packages in the browser with Browserify
A convenient way to use CommonJS npm packages in client-side JavaScript using Browserify.