CLI tool to transform javascript programs using falafel
npm install rewrite-jsA CLI tool for transforming JavaScript input using falafel
and cssauron. Works great with Vim!
``bash
`
Transformation modules should export and object mapping cssauron-falafel
selectors to transformation functions.
`javascript
// example transform
module.exports = {
'call:contains(async) > function:last-child': rewrite_async_wrap
}
function rewrite_async_wrap(node) {
node.parent.update(node.source())
}
// takes async(function() { }) and rewrites it to function() { }`
npm install -g rewrite-js`
MIT