alidavut / locus Goto Github PK
View Code? Open in Web Editor NEWLocus is a debugging module for node.js
Locus is a debugging module for node.js
I'd love to be able to use this to stop my angular tests under karma/phantom.js
Hello, great tool. I use it every day. However, it would be nice to do an arrow up to get back to the code you just tested to modify so we don't need to type it again!
Hi, thanks for locus. What needs to be done to enable normal terminal behavior where hitting the up arrow would show historic commands?
First off, this is amazing! I'm trying to debug an electron app, and the built in debugger sucks and crashes all the time. The pryjs package won't load at all. I installed this, and it did exactly what I expected right away.
Now, when I try to define a new variable in the console (like you can with pry), I just get undefined returns.
ʆ: var i = 0;
undefined
ʆ: i
ReferenceError: i is not defined
I'm not even sure of what your lib does (since doc is so short). I guessed it is a debug tool.
I try to follow the README and can't see any effect.
npm install locus
var locus = require('locus')
console.log('Hello world !');
var foo = 'bar';
eval(locus);
Would you mind enhancing the README a little ?
This looks great (I love and dearly rely on binding.pry
in ruby. However as far as I can tell, sync-prompt
has build issues with node 0.11, 0.12 and iojs 1.8.1. So it's sort of a barrier to use. Thanks.
Related issues:
shovon/sync-prompt#11
shovon/sync-prompt#15
What does this module do? All I can tel from the readme is that this is meant to be used on a REPL, but opening a REPL with "with access to all variables" means literally nothing to me. Please clarify. The example with a screenshot didn't help..
Hey,
I think it's possible and useful to add autocompletion to locus, I really like the idea, a true debugging assistant.
I'm a little busy with a few open-source projects and some other work, but I will definitely take a look, what do you think @alidavut?
I get this whenever I try to type anything after the REPL is shown. Not in all places of the script, but in many. I don't know why, perhaps because I'm calling it inside callback functions or some other async magic?
Here's an example:
/home/fiatjaf/comp/wft/trelew/index.js - Line: 194
————————————————————————————————————————————————————
186 :
187 : // list comments
188 : var comments = vorpal.find('comments')
189 : if (comments) comments.remove()
190 : vorpal
191 : .command('comments', "list this card's comments.")
192 : .alias('ls comments')
193 : .action(function (_, cb) {
ʆ: readline.js:924
throw err;
^
TypeError: Generator is already running
at next (native)
at ReadStream.onData (readline.js:918:36)
at emitOne (events.js:77:13)
at ReadStream.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
at ReadStream.Readable.push (_stream_readable.js:110:10)
at TTY.onread (net.js:523:20)
at Function.module.exports.loopWhile (/home/fiatjaf/comp/wft/trelew/node_modules/deasync/index.js:64:21)
at CommandInstance.listener (eval at <anonymous> (/home/fiatjaf/comp/wft/trelew/index.js:195:14), <anonymous>:95:11)
at eval (eval at <anonymous> (/home/fiatjaf/comp/wft/trelew/index.js:195:14), <anonymous>:96:4)
fiatjaf@spooner ~/c/w/trelew>
Got following error when calling a function containing "eval(locus)":
Error: ENOENT: no such file or directory, open 'repl'
It would be great if it is possible to debug inside node console.
I am using WSL, but it seems like this issue is more general for Windows. Installation works, and the first run of locus appears to work fine as well. However, after exiting, all subsequent calls to locus produce something like this
File : /home/kloughead/projects/API_demo/app.js @ line: 12
6: const request = require('request');
7: require('locus');
8:
9:
10: request('https://jsonplaceholder.typicode.com/users/1', function(error, response, body) {
11: if (!error && response.statusCode == 200) {
=> 12: eval(locus)
13: var parsedData = JSON.parse(body);
14: console.log(parsedData);
15: }
internal/fs/streams.js:59
throw new ERR_OUT_OF_RANGE(name, '>= 0 and <= 2 ** 53 - 1', pos);
^
RangeError [ERR_OUT_OF_RANGE]: The value of "start" is out of range. It must be >= 0 and <= 2 ** 53 - 1. Received -25580
at checkPosition (internal/fs/streams.js:59:11)
at new ReadStream (internal/fs/streams.js:115:5)
at Object.createReadStream (fs.js:1835:10)
at onLoad (/home/kloughead/projects/API_demo/node_modules/readline-history/readline-history.js:55:25)
at ReadStream.onend (/home/kloughead/projects/API_demo/node_modules/readline-history/readline-history.js:48:21)
at ReadStream.emit (events.js:333:22)
at endReadableNT (_stream_readable.js:1201:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
at process.runNextTicks [as _tickCallback] (internal/process/task_queues.js:66:3)
at Function.module.exports.loopWhile (/home/kloughead/projects/API_demo/node_modules/deasync/index.js:70:11) {
code: 'ERR_OUT_OF_RANGE'
}
I am taking a course on Udemy and there are others having similar issues. We were told by the teaching assistant to try installing version 2.0.0, but that fails also. Installation works, all calls stop just for the interactive portion. That is, you see something like this:
6: const request = require('request');
7: require('locus');
8:
9:
10: request('https://jsonplaceholder.typicode.com/users/1', function(error, response, body) {
11: if (!error && response.statusCode == 200) {
=> 12: eval(locus)
13: var parsedData = JSON.parse(body);
14: console.log(parsedData);
15: }
$
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.