Slippers
Nodejs with slippers, confortable like wearing slippers, but INFORMAL, JUST FOR FUN.
Slippers is inspired by streamlinejs and Jscex. If you really need this feature, please try streamlinejs or Jscex
You just need end with a _
in the async call, you can got the magic.
Usage
run npm install slippers
edit test.js
var data = fs;console;
run slippers test.js
var cb=globalcb || {console};fs;
See demo.js and demo.out.js for more information.
function define
{ return bar1 bar2;}// compile to =>{ ;}
parallel
var bar1 bar2 bar3 bar4;parallel bar1 bar2 = ; bar3 bar4 = ;console;// compile to =>var bar1 bar2 bar3 bar4;{ { if--count==0 } var count=2; ; ; }{ iferrreturn ; console; };
You can use //}
for manually end up the async block if you want.
Map line-num for debug?
No need, the compiled js keep the same line number with source.
Note
- It is not a really compiler, so you must pay attention to code style.
- {} must be pairs, even in block comments.
- close block in a single line without expression. e.g.
foo.bar();}
is wrong - close ONE block in ONE line, e.g.
});});
is wrong ,}}
is wrong.
- You should not use slippers in projects, the syntax are not stable yet, it's just an experiment for now.
- It's welcome to let me know your idea on issue pages.