LinuxCommandLibrary

decaffeinate

convert CoffeeScript to modern JavaScript

TLDR

Convert CoffeeScript to JavaScript

$ decaffeinate [file.coffee]
copy
Convert to modern JavaScript
$ decaffeinate --use-cs2 [file.coffee]
copy
Output to specific file
$ decaffeinate [file.coffee] -o [output.js]
copy
Convert directory
$ decaffeinate [src/]
copy

SYNOPSIS

decaffeinate [options] files...

DESCRIPTION

decaffeinate converts CoffeeScript to modern JavaScript (ES6+). It produces idiomatic JavaScript with proper class syntax, arrow functions, template literals, and destructuring.
Useful for migrating CoffeeScript codebases to JavaScript.

PARAMETERS

-o, --output file

Output file path.
--use-cs2
Use CoffeeScript 2 compatibility.
--disable-babel-constructor-workaround
Disable Babel class workaround.
--loose
Enable loose mode for simpler output.

CAVEATS

Some CoffeeScript patterns may require manual cleanup. Review generated code for edge cases.

SEE ALSO

coffee(1), babel(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community