Node.js REPL history

Josh Sherman
1 min read
Command-line Interface Node.js JavaScript

Node.js has included a persistent history with it’s REPL (real-eval-print loop) for quite some time now. It’s a fantastic quality of life feature, and it even supports reverse-i-search.

The other day, I got to wondering, where the heck does this history even live?

Turns out, it’s just living in a text file in your home directory, similar to how bash and zsh handles it.

The file in question is, ~/.node_repl_history.

It contains a history, sans any sort of time of execution, of the commands you’ve entered into the Node.js REPL. The most recent entries are at the top of the file.

Since it’s just a simple text file, if you ever did want to clear the file out, you could do so by running:

echo > ~/.node_repl_history
Join the Conversation

Good stuff? Want more?

Weekly emails about technology, development, and sometimes sauerkraut.

100% Fresh, Grade A Content, Never Spam.

About Josh

Husband. Father. Pug dad. Musician. Founder of Holiday API, Engineering Manager and Emoji Specialist at Mailshake, and author of the best damn Lorem Ipsum Library for PHP.

Currently Reading

Parasie Eve

Previous Reads

Buy Me a Coffee Become a Sponsor

Related Articles