2020 Node.JS Quick Upgrade Guide

Jack Yeh
TeamZeroLabs
Published in
8 min readNov 15, 2020

--

Bring your repository into the future in 5 easy steps.

Photo by Ian Simmonds on Unsplash

Background

Raise your hand if you have a web service written in Node running in production from 2017 and earlier untouched.

If, like me, you have more micro-services fingers on your hands, you know that some of them are long overdue for a proper upgrade. Old repository often features the following symptoms:

  • Nested Callback/Promises everywhere
  • Ambiguous function input/output types
  • Mixed formatting and spacing, no clear structure of functionality and naming convention
  • Lackluster error logging
  • Zero reporting and monitoring support

Fear not, we know exactly the remedy for each of these symptoms, read on to see how to tackle each sections and bring your repository into the future today!

1. Nested Callbacks/Promises everywhere

Back in 2017, many popular coding libraries did not have support for Promises. We wrote code with dubious execution paths which can lead to hard to track down bugs.

Example: A route that saves a record into database and log an event to analytics.

--

--

Jack Yeh
TeamZeroLabs

I monitor your full stack deployment in production, so you can sleep at night. Docker | Kubernetes | AWS | Prometheus | Grafana