Skip to content

Code with Node.js

  • Developer Tools
  • Snippets
  • Servers and APIs
  • Browser Automation
  • Frontend
  • Templating
  • Contact
Code with Node.js
  • Contact
  • Developer Tools
    • Base64 Encode / Decode Online
    • Convert SVG clip-path to 0-1 relative coordinates
    • Free Online Image Converter

Simple load balancer with Docker, Nginx and Node.js

Leave a Comment / Builds and Pipelines, Servers and APIs

It is a common knowledge that Node.js is a single-threaded single-core process. It sounds like an issue, but it gives you full freedom over how many processes you can run and how many cores want to utilize.

…

Simple load balancer with Docker, Nginx and Node.jsRead More »

Block user based on IP address in Express or any other Node HTTP server

Leave a Comment / Servers and APIs

This is an easy task, but you will need to find a way to get the user’s IP address. And here’s how.

…

Block user based on IP address in Express or any other Node HTTP serverRead More »

Running Node.js with Docker

Leave a Comment / Builds and Pipelines

You don’t have to install Node and manage different Node versions on your system. Everything can be done with Docker, including packaging your Node.js app into a distributable Docker image.

…

Running Node.js with DockerRead More »

error TS2792: Cannot find module ‘moment’. Did you mean to set the ‘moduleResolution’ option to ‘node’, or to add aliases to the ‘paths’ option?

Leave a Comment / Frontend, Snippets

Got this error when trying to import moment into a TypeScript React (.tsx) module?

…

error TS2792: Cannot find module ‘moment’. Did you mean to set the ‘moduleResolution’ option to ‘node’, or to add aliases to the ‘paths’ option?Read More »

Detect user country by IP in Node.js

Leave a Comment / Data Processing, Servers and APIs

It shouldn’t be hard to detect a user’s country based on the IP address, right? Right… I really liked the simplicity of ip2location module: load the BIN file, get the location, and close the BIN file.

…

Detect user country by IP in Node.jsRead More »

Cannot augment module ‘console’ with value exports because it resolves to a non-module entity.

Leave a Comment / Builds and Pipelines, Snippets

This error message appears when typings are exposed globally, yet TypeScript tries to validate module typings and the names conflict.

…

Cannot augment module ‘console’ with value exports because it resolves to a non-module entity.Read More »

I asked OpenAI’s GPT-3 if it was possible to make an HTTP/3 request with Node.js, and the result was weird.

Leave a Comment / Servers and APIs

Can you make an HTTP/3 request with Node.js? I asked that question on OpenAI’s playground to see how it handles the question that doesn’t have the answer.

…

I asked OpenAI’s GPT-3 if it was possible to make an HTTP/3 request with Node.js, and the result was weird.Read More »

Push instant updates with EventSource API

Leave a Comment / Frontend, Servers and APIs

EventSource is a handy API supported by all browsers, which runs over the regular HTTP protocol and doesn’t require setting up a separate WebSocket service. However, it has limitations, such as data being one-directional (server to client) or a connection being constantly occupied. Let’s dive in.

…

Push instant updates with EventSource APIRead More »

5 ways to create an HTTP/HTTP2 server with Node.js.

Leave a Comment / Servers and APIs, Snippets

Node.js can be used to easily run a web server by using the built-in HTTP module or a web framework such as Express, Hapi, or Fastify. The process involves creating an HTTP server, setting up routes, and starting the server to listen on a specific port for incoming requests.

…

5 ways to create an HTTP/HTTP2 server with Node.js.Read More »

Convert all JPGs and PNGs in a folder to WEBP and AVIF with Node.js and Sharp

Leave a Comment / Builds and Pipelines, Data Processing

One of the easiest ways to convert all JPG and PNG images in a folder to WEBP and AVIF is to use the Sharp library.

…

Convert all JPGs and PNGs in a folder to WEBP and AVIF with Node.js and SharpRead More »

Posts navigation
1 2 … 4 Next Page →

About “Code with Node”

This is a personal blog and reference point of a Node.js developer.
I write and explain how different Node aspects work, as well as research popular and cool packages.

Quick Links

  • Home
  • Free Online Image Converter
  • Developer Tools
  • Snippets
  • Contact

Popular Posts

  • error TS2792: Cannot find module ‘moment’. Did you mean to set the ‘moduleResolution’ option to ‘node’, or to add aliases to the ‘paths’ option?
    Got this error when trying to import moment into a TypeScript React (.tsx) module? To fix the issue, you will need to adjust your tsconfig.json file and add "moduleResolution": "node" ...
  • Cannot augment module ‘console’ with value exports because it resolves to a non-module entity.
    This error message appears when typings are exposed globally, yet TypeScript tries to validate module typings and the names conflict. I got this with a Figma widget module @figma/plugin-typings, and ...
  • Building a Preact application into a standalone script with Rollup
    Rollup is a module bundler for JavaScript, made for speed and simplicity of setup. It also does tree-shaking (imports only the functionality you actually imported), supports JSX compilation and provides ...
  • Convert all JPGs and PNGs in a folder to WEBP and AVIF with Node.js and Sharp
    One of the easiest ways to convert all JPG and PNG images in a folder to WEBP and AVIF is to use the Sharp library. Let's get straight to the ...
  • Simple load balancer with Docker, Nginx and Node.js
    It is a common knowledge that Node.js is a single-threaded single-core process. It sounds like an issue, but it gives you full freedom over how many processes you can run ...

Subscribe to “Code with Node”

Loading

Copyright © 2023 Code with Node.js