Published at
Updated at
Reading time
1min
This post is part of my Today I learned series in which I share all my web development learnings.

Today my friend Dominik shared that there are special commands available in the Node.js REPL.

There are seven Node.js REPL commands:

  • .break
  • .clear
  • .exit
  • .help
  • .save
  • .load
  • .editor

My favorite is the .editor command which you can use to write JavaScript going beyond one line right in the REPL.

And then there's also .load and .save to store and restore REPL sessions. These commands come in handy when moving out of the REPL again to export the executed code or start a REPL session quickly with a given state.

Commands in the Node.js REPL

Learn more about these in the Node.js docs.

If you enjoyed this article...

Join 5.2k readers and learn something new every week with Web Weekly.

Web Weekly — Your friendly Web Dev newsletter
Stefan standing in the park in front of a green background

About Stefan Judis

Frontend nerd with over ten years of experience, freelance dev, "Today I Learned" blogger, conference speaker, and Open Source maintainer.

Related Topics

Related Articles