1.1.0 • Published 8 years ago

rewrite-js v1.1.0

Weekly downloads
11
License
MIT
Repository
github
Last release
8 years ago

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

1.1.0

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

10 years ago

1.0.0

11 years ago

0.0.1

11 years ago

0.0.0

11 years ago