If you’ve ever used the Laravel PHP framework, you’re probably familiar with the php artisan:tinker  command. It spins up a PHP REPL (read-evaluate-print loop ) that lets you play around with the data in your database using the same model code defined in your app. My team works almost exclusively in TypeScript on Node.js, but many of us have backgrounds as Laravel devs, and we missed the convenience of Tinker. When you’re first starting a project, it’s an easy way to seed test data, and it can be much more convenient than firing up a client to poke around your database. Our home-grown Node application didn’t have this luxury, and I was curious what it would take to implement it. Turns out, it’s incredibly easy. You can write custom REPLs in Node in minutes.

#node #nodejs #web-development

Writing Custom REPLs in Node.js
4.00 GEEK