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

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 »

fetch() with timeout

Leave a Comment / Frontend, Servers and APIs

Being from early JavaScript days, you might’ve been used to setting a timeout for all your HTTP requests in jQuery or libraries like axios, request, etc. Yet to your surprise, there’s no timeout parameter for native browser’s fetch.

…

fetch() with timeoutRead More »

Prevent CSS column break within an element

Leave a Comment / Frontend, Snippets

You might have had this while using the CSS columns rule and getting rid of all those JavaScript libraries. One of the elements got suddenly cut and wraps to the next column.

…

Prevent CSS column break within an elementRead More »

Convert all PNGs in a folder to WEBP with FFmpeg

Leave a Comment / Data Processing, Snippets

FFmpeg is an awesome tool that can convert not only videos but also audio and images.

…

Convert all PNGs in a folder to WEBP with FFmpegRead More »

Simple responsive HTML/CSS maintenance page with black-and-yellow construction stripes

Leave a Comment / Frontend, Snippets

Here is a simple maintenance page with a black-and-yellow construction stripe at the top.

…

Simple responsive HTML/CSS maintenance page with black-and-yellow construction stripesRead More »

Pure CSS toggle switch

Leave a Comment / Frontend, Snippets

There’s no need to use a library to implement a nice toggle for your project. This can be done with pure CSS and completely zero JavaScript.

…

Pure CSS toggle switchRead More »

Save full-page screenshots with Chrome

Leave a Comment / Browser Automation, Snippets

Whenever you need to save a full-page screenshot, there’s no need to make several screenshots or make your browser window unbelievably large.

…

Save full-page screenshots with ChromeRead More »

Convert bytes to megabytes, gigabytes, terabytes without a loop.

Leave a Comment / Data Processing, Snippets

What if I tell you you can convert bytes to petabytes without doing a loop and constantly dividing by 1024?

…

Convert bytes to megabytes, gigabytes, terabytes without a loop.Read More »

Posts navigation
1 2 3 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
  • Developer Tools
  • Snippets
  • Contact

Popular Posts

  • 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 ...
  • How to create a simple contact form with Node.js?
    Project initialization. Let's start by creating an empty folder and initializing our package.json with npm init. We will also include express to set up our application, express-validator to validate the ...
  • 5 ways to create an HTTP/HTTP2 server with Node.js.
    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 ...
  • How to check image EXIF with plain JavaScript.
    It's not a secret that JavaScript can be very used for pretty much everything, from calculating simple math to reading binary data and to generating 3D models. In this example ...
  • Prevent CSS column break within an element
    You might have had this while using the CSS columns rule and getting rid of all those JavaScript libraries. One of the elements got suddenly cut and wraps to the ...

Subscribe to “Code with Node”

Loading

Copyright © 2023 Code with Node.js