Thursday, 27 April 2017

save and restore nodejs REPL session

I want to save the nodejs repl session to file. And from the file I can restore the status of that session, including user defined global variables and functions.

For example, if I type

a=1;b={x:1};b.__proto__={y:2};f=()=>{console.log(1)};

I want to save the session to a file and when restored the session from it, I can get a session with 3 global variables a,b,f, which have been properly set.



via mysyljr

No comments:

Post a Comment