Skip to content

bpostlethwaite/plast

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

plast

parse lovely AST's to make module wrapping more fun.

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.js

This tells plast to parse the AST of myscript.js and print all the functions at a functional depth of 1 in the AST.

  • -f is mandatory
  • -d defaults to 0
  • -g tells plast to print function names
example>> echo "wrapfuncs getfuncs" | plast -w "plast" -f cmd.js

Wrap wrapfuncs and getfuncs functions with wrapper plast so that we get plast.wrapfuncs, plast.getfuncs. 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.js > outfile.js

yeh!

Installation

>> npm install -g plast

About

parse lovely AST's to make module wrapping more fun

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published