Commands in the Node.js REPL

1 min read

This post is part of my Today I learned series in which I share all my learnings regarding web development.

Today my friend Dominik wrote a tweet describing that there are special commands available in the Node.js REPL.

In total there are seven commands which I didn't know of. 🎉

Using the .editor command you can switch modes which allows to write JavaScript that goes beyond one line in editor mode. And then even more exciting you can use .load and .save to well... save and load REPL sessions. This can definitely come in handy when moving out of the REPL again to simply export the executed code or when starting a REPL session to set up a given state quickly. Cool stuff!

Load time