Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
CLI tool to transform javascript programs using falafel
JavaScript Ruby
branch: master
Failed to load latest commit information.
bin initial commit
.npmignore
README.md
index.js remove errant console.log
package.json

README.md

rewrite-js

A CLI tool for transforming JavaScript input using falafel and cssauron. Works great with Vim!

# usage: rewrite-js [tranform-module, ...]
$ cat myfile.js | rewrite-js transform.js > myfile-transformed.js

Transformation modules should export and object mapping cssauron-falafel selectors to transformation functions.

// 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() { }`

Installation

npm install -g rewrite-js

License

MIT

Something went wrong with that request. Please try again.