Read more

How to: Migrate from CoffeeScript to ES6

Emanuel
May 22, 2019Software engineer at makandra GmbH

It is quite easy to migrate from CoffeeScript to ES6. You can use decaffeinate Show archive.org snapshot to convert your CoffeeScript source to modern JavaScript.

Installation

  • Install the NPM module globally yarn global add decaffeinate
  • Add the following line to your ~/.bashrc to export the Yarn binaries in your Bash
export PATH="$PATH:$(yarn global bin)"
  • Run decaffeinate some.coffee to get the converted modern JavaScript file.

Notes

  • decaffeinate will add some suggestions Show archive.org snapshot to your newly generated JS file with advises that makes you JS cleaner. This action need to be done manually and carefully checked.
  • You might want to use the options Show archive.org snapshot --prefer-let and --use-js-modules
  • If you get errors while decaffeinating, try deleting your babel.config.js, run decaffeinate, restore the babel config file.
Illustration money motivation

Opscomplete powered by makandra brand

Save money by migrating from AWS to our fully managed hosting in Germany.

  • Trusted by over 100 customers
  • Ready to use with Ruby, Node.js, PHP
  • Proactive management by operations experts
Read more Show archive.org snapshot
Posted by Emanuel to makandra dev (2019-05-22 15:43)