Published at
Updated at
Reading time
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.

Was this TIL post helpful?
Yes? Cool! You might want to check out Web Weekly for more quick learnings. The last edition went out 8 days ago.
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