lumpy-turnips / minty Goto Github PK
View Code? Open in Web Editor NEWStep by step visualization of node processess
License: MIT License
Step by step visualization of node processess
License: MIT License
Hi,
Trying to run simple example, I have created simple index.js
and minty.js
with following
// minty.js
const minty = require('minty')
minty.file(require('path').join(__dirname, 'index.js'))
I get the jquery error (-1 is correct console log print from index.js)
$ node minty.js
-1
Minty has finished analyzing index.js
fs.js:584
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open '/Users/gleb/git/test-minty/node_modules/minty/node_modules/jquery/dist/jquery.min.js'
at Error (native)
When I try using this code:
minty.file(path.join(__dirname, 'test.js'));
in any combination, it never works, always complaining about some path-related issues, like this one:
{ [Error: ENOENT: no such file or directory, open 'D:\NodeJS\tests\minty\file\D:\NodeJS\tests\test.js_Sun_Apr_17_2016_13-40-35_GMT+0100_(GMT_Daylight_Time).html']
errno: -4058,
code: 'ENOENT',
syscall: 'open',
path: 'D:\\NodeJS\\tests\\minty\\file\\D:\\NodeJS\\tests\\test.js_Sun_Apr_17_2016_13-40-35_GMT+0100_(GMT_Daylight_Time).html' }
I only can make it work by using this:
minty.file('test.js');
Which then produces:
#################################################################################
Minty has found an error! Please check the out put of test.js for more details
#################################################################################
Minty has finished analyzing test.js
when I check that file, all I'm seeing is this:
No links, no error reporting,...in fact nothing useful at all. What am I missing?
UPDATE
On another-re-read... it says:
Click forward and back to step through your variables' state as your app executes!
When My app executes, it generates that report, and then it's done. How do I do that parallel running to see the app execute?
Need to fix issue when wrapping output data that contains circular reference.
About this code:
minty.splitFile = function splitFile(results, file, callback) {
results = decomment(results, {
space: true
});
results = decomment(results);
results = results.split('\n');
callback(null, results, file);
};
May I ask, what the second call into decomment
is supposed to accomplish? The first one removes all comments, replacing them with white spaces, as per option space
. And the second one - it won't do anything, imo (I'm the author of decomment
).
The other bit is interesting:
results = results.split('\n');
It made me realize that I should have exposed the method to correctly determine the End-of-Line a while back, so I did it in version 0.8.6 just now.
If you want to use the correct End-of-Line, update to 0.8.6 and use this:
var EOL = decomment.getEOL(results);
results = results.split(EOL);
Example:
'use strict';
const minty = require('minty');
const http = require('http');
const testDoc = `
<html>
<head>
<title>Minty Node Example</title>
<script type="text/javascript">
var alertContent = 'If this alert shows, you have done a great job!';
function showAlert(string) {
alert(string);
}
</script>
</head>
<body onload="showAlert(alertContent);">
<h1>Minty Node Example</h1>
<p>
<a onclick="showAlert(alertContent)">Click to show alert again</a>!
</p>
</body>
</html>
`;
const testHeader = { 'Content-Type': 'text/plain' }
function sendContent(response, content, header) {
response.writeHead(200, header);
response.end(content);
}
var sendMinty = minty.wrap(sendContent);
http.createServer((req, res) => {
sendMinty(res, testDoc, testHeader);
}).listen(3000);
minty.wrap(function (){}) and any variation throws am esprima error
Generator functions when minty.wrapped yield undefined
Example:
const minty = require('minty');
function* fooMaker(bar) {
yield bar * 2;
yield* fooMaker(bar);
}
var one = fooMaker(2);
console.log(one.next().value);
console.log(one.next().value);
console.log(one.next().value);
var two = minty.wrap(fooMaker);
console.log(two(2));
/* returns
{}
4
4
4
undefined // should be 4
*/
Function expressions are not being hoisted correctly, i.e.,
var func = function() {
console.log('hi')
}
the variable func will only appear in the output while in the function block
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.