Web Asset Graph
The most obvious usage (to me) is building highly optimized website deploys by traversing the graph and applying operations (minification, renaming based on hashing, app cache generation, etc.)
This could become part of a grunt workflow, or you could build your own custom tools. It's up to you.
This tool is inspired by assetgraph and assetgraph-builder.
cd projectdirwag --inp public/ --out deploy/ --cdnroot mycdn.cloudfront.net --hash --minify
What this does:
public/directory, writing them out to
/img/dog.pngis re-rewritten to
/static/343e32abce3968feac.pngis re-written to
AssetGraph = require'wag'AssetGraphroot = '/Users/mike/wwwroot/mywebsite'ag = root# load all of the asset files directlyagloadAssets 'index.html'agloadAssets 'js/'consolelog "\nloaded assets"agminifyAssetsagmoveAssets 'static/'out = '/Users/mike/Desktop/deployfolder'# rename each file (except for index.html) to an md5 hash of it's contentsuseHashName = trueagwriteAssetsToDisc outuseHashName