Code with Hugo

Node.js and JavaScript Guides

  • Home
  • Books
  • Node
  • Testing
  • JavaScript
  • More...
  • Search
  • About
  • Gear & Setup
Subscribe
#node #javascript #Express #Docker #redis

Bring Redux to your queue logic: an Express setup with ES6 and bull queue

There always comes a point in a web application’s life where an operation is best served in the background, this is where queues come in. There are a few queuing solutions in Node. None of them are ridiculously dominant, eg. Kue, RSMQ, Bee Queue, bull. The issue with Kue, R ...

  • Hugo Di Francesco
    Author
11 min read
#javascript #node

ES6 by example: a module/CLI to wait for Postgres in docker-compose

When using docker-compose, it’s good practice to make anything that relies on Postgres wait for it to be up before launching. This avoids connection issues inside the app. This post walks through how to deliver this functionality both as a CLI and a module that works both as a Co ...

  • Hugo Di Francesco
    Author
9 min read
#javascript #rxjs #reactive programming

Better HTTP Polling in JavaScript with RxJS 5

Here is the implementation for a function that takes a Promise-based fetch function (eg. using axios) and a function that decides if a response has been successful (from a polling perspective) and polls the fetch function until the isSuccess function returns true: ...

  • Hugo Di Francesco
    Author
2 min read
#CSS #tip #accessibility

Responsive, semantic images with CSS

CSS tip: object-fit your images. To have an image that doesn’t try to stretch to its width/height the classic CSS is as follows: ...

  • Hugo Di Francesco
    Author
1 min read
#jest #javascript #node #Express

Testing an Express app with SuperTest, moxios and Jest

Testing is a crucial part of the software development process. It helps to catch bugs, avoid regressions and to document the behaviour of a piece of software. Express is one of the most widespread libraries for building backend applications in JavaScript. What follows is a summar ...

  • Hugo Di Francesco
    Author
6 min read
#node #javascript #cli

How to make beautiful, simple CLI apps with Node

Channel your inner Sindre Sohrus and ship a beautifully simple CLI app using Node. Command line apps are a neat way to package repetitive tasks. This will walk you through some tools that are useful to build CLI apps. ...

  • Hugo Di Francesco
    Author
3 min read
#express #node #javascript #docker #redis

A Docker/docker-compose setup with Redis and Node/Express

Redis and Express are tools that provide a simple and clean approach to their problem domains. What follows is a Docker/Docker Compose v2 setup. The repo is available at: https://github.com/HugoDF/express-redis-docker. The docker-compose.yml is available at: github.com/HugoDF/exp ...

  • Hugo Di Francesco
    Author
5 min read
#vuejs #jest #testing #javascript

From AngularJS to Vue.js, CommonJS and Jest

The trials and tribulations of kicking off an AngularJS -> Vue.js migration AngularJS was pretty groundbreaking. It’s still impressive to this day, packed with a router, an HTTP client, a dependency injection system and a bunch of other things I haven’t necessarily had the pl ...

  • Hugo Di Francesco
    Author
7 min read
#git #web development #productivity

Split an existing git commit

One of git’s main differences when compared to other version control systems is that it lets the user rewrite the history. The main way to do this is to use git rebase, usually followed by a git push --``force to overwrite history the remote with the local history. Here’s a ...

  • Hugo Di Francesco
    Author
2 min read
#javascript #vuejs #web development

A simple, real-world Vue.js directive example

Vue.js is “The Progressive JavaScript Framework”. It takes inspiration from all prior art in the view library and frontend framework world, including AngularJS, React, Angular, Ember, Knockout and Polymer. In Vue (and Angular/AngularJS), a directive is a way to wrap f ...

  • Hugo Di Francesco
    Author
4 min read
← Next Posts Page 13 of 15  Previous Posts →

Interested in Alpine.js?

Power up your debugging with the Alpine.js Devtools Extension for Chrome and Firefox. Trusted by over 15,000 developers (rated 4.5 ⭐️).

Install Now close
Code with Hugo
Latest Posts Github