
Nov 19, 15:00
Interactive Debugging and Control in Node.js With REPL
Workshop
You probably have faced a situation where you needed to debug something particular in your application. Something in a specific condition. These kinds of situations tend to be poorly handled by us developers.A common approach is adding a bunch of logs, deploying the code, and waiting for the logs to return. This is a very slow process and can be very frustrating.It would be much better if you could just get into the environment, while running, execute some code, and see the results. This is where the node:repl module comes in. It allows you to create a Read-Eval-Print Loop (REPL) in your Node.js application.Inspired by Ruby on Rails, which has a very useful console, I implemented a console in the application I was working on. It was a game changer. Now, we have a way more effective debugging/experimentation process. My team fell in love with it. Now, it's part of the app, as it always has been.Another good thing is that it was not hard to implement. The node:repl module gives everything. We just need to ensure the application is properly bootstrapped to use the REPL module.Table of contentsThe importance of tools and DXThe module node:replHands-on: creating an iterative repl for debugging any applicationConclusionTakeawaysWhy DX matters and how to improve it through the development of custom toolsHow Node.js modules can help with the creation of effective toolsGet to know the node:repl module