danielgtaylor / danielgtaylor/nesh
How do I get global variables within nodejs
- Dominant language
- CoffeeScript
- Stars
- 284
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
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);
}
});
```
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue names no source file or test; begin by reproducing the provided Node.js snippet in the nesh prompt and tracing how nesh exposes context and exits. Done means the prompt can access myvar and the application event loop can resume after leaving nesh.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100