danielgtaylor / nesh

An enhanced, extensible interactive shell for Node.js and CoffeeScript
http://danielgtaylor.github.io/nesh/
MIT License
287 stars 27 forks source link

How do I get global variables within nodejs #42

Open wyattbiker opened 8 years ago

wyattbiker commented 8 years ago

I have this code below. but when I start into the nesh prompt, i cannot access the global variable myvar

Is there a context to access it from? i looked at global but was not there either

Also how do I exit nesh to continue running my application event loop.

//var keypress = require('keypress');
var nesh=require("nesh");
var myvar=123;
opts = {
    welcome: 'Welcome!',
    prompt: 'test> '
};

nesh.start(opts, function (err) {
if (err) {
   nesh.log.error(err);
}
});