plast
v0.0.2
Published
wrap functions in module namespacing, print functions at different depth levels
Readme
plast
parsing AST analyizer
Usage
Plast code has been copied into the example directory and the module name plast has been stripped from cmd.js for testing. Go ahead and try it.
example>> plast -g -d 1 -f index.jsThis tells plast to parse the AST of myscript.js and print all the functions at a functional depth of 1 in the AST.
-fis mandatory-ddefaults to0-gtells plast to print function names
example>> echo "wrapfuncs getfuncs | plast -w "plast" -f cmd.jsWrap func1 func2 and func3 with wrapper so that we get wrapper.func1, wrapper.func2 and wrapper.func3.
Output is a console log of the transformed source file.
Bonus points
example>> plast -g -d 1 -f index.js | plast -w "plast" -f cmd.jsyeh!
Installation
'''bash
npm install -g plast
