easy-repl

Easy way load a node.js file into node REPL without cluttering up your history (like in Python)

Downloads
12
Stars
3
Committers
1

##EasyRepl -easily add a repl to your .js file with all the variables in the file in its scope

-similar to the -i flag in pyton, eg. python -i myscript.py

##How to use

Add the following at the end of your myFile.js file

 if (require.main === module) {
     eval(require('easy-repl'));
 }

Then from the command line, you can type node myfile.js and it will execute all functions in myfile.js and load all module level and global objects into your scope and throw you into a REPL so you can interactively debug your code.

Yes, you can do a .load myfile.js from within node, but that completely messes up your REPL history