Making Node.js Backend Localization for error messages

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • yup

  • And now let's move on to validation, for example, I will take a fairly popular library Yup.

  • fastify

    Fast and low overhead web framework, for Node.js

  • And now let's put everything together, and get a lightweight and flexible localization mechanism. And we will collect everything in place at the time of error handling, since Fastify is already able to handle exceptions out of the box, and using the setErrorHandler we can customize it, which will allow us to check if the error is an instance of the HttpError class, then try to check for slots, and send a message to the user.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts