Skip to content

Instantly share code, notes, and snippets.

@ideiudicibus
Last active November 22, 2017 12:15
Show Gist options
  • Save ideiudicibus/effe99851b7aee92fe91ea6228d91a04 to your computer and use it in GitHub Desktop.
Save ideiudicibus/effe99851b7aee92fe91ea6228d91a04 to your computer and use it in GitHub Desktop.
convert and remove coffeescript files
I don't like coffeescript syntax and I discovered that I'm not alone.
This project does the work:
http://decaffeinate-project.org/
usage:
# install locally
$ npm install -g decaffeinate
# convert a single file
$ decaffeinate index.coffee
# convert a whole project
$ decaffeinate src/
# consider also this technique when you want to exclude some directories from the convertion
$ find . -name "*.coffee" -not -path "*PATHNAME_1*" -not -path "*PATHNAME_2*" -exec decaffeinate {} \;
# remove the .coffee files
$ find . -name '*.coffee' -exec rm {} \;
# commit the result
$ git add -A
$ git commit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment