Skip to content
jshacks.dev

Tag

beginner

36 posts

Flat illustration of an editor window full of code, with the JavaScript, npm, Node.js, Vite and TypeScript logos.
Functions

How to Add Logging Around Any Function

Wrap any JavaScript function with logging for arguments, results, errors and duration, handle async functions, keep this, and avoid leaking secrets. Node.js 24.

7 min read
Flat illustration of a rising bar chart and a gauge, with the Node.js, NGINX and Redis logos.
Node.js

How to Use All CPU Cores With cluster

Run one Node.js HTTP server per CPU core with node:cluster: fork workers, share a port, restart crashed workers and know when a process manager is simpler.

8 min read