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 web development

Do you need DevOps-experts?

Your development team has a full backlog? No time for infrastructure architecture? Our DevOps team is ready to support you!

  • We build reliable cloud solutions with Infrastructure as code
  • We are experts in security, Linux and databases
  • We support your dev team to perform
Read more Show archive.org snapshot
Posted by Emanuel to makandra dev (2019-05-22 15:43)