Skip to content

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

Notifications You must be signed in to change notification settings

yegodz/easy-repl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

##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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published