Decaf JS is a CoffeeScript-to-ES.next transpiler that leverages the CoffeeScript compiler to build a syntax tree and then outputs modern JavaScript. The current stable version is 0.1.0, with infrequent releases. Its key differentiator is the ability to fall back to the CoffeeScript compiler output for unsupported syntax, aiming to cover the full CoffeeScript language. It can be used as a CLI tool or integrated as a code transform with tools like jscodeshift. It uses ast-types for building an esprima-compatible AST and recast for printing JavaScript.
npm install bouk-decafjsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to compile a simple CoffeeScript arrow function to JavaScript using decaf with recast options.
Check the test suite for supported features; contribute or submit issues for unsupported syntax.
Consider alternatives like CoffeeScript's own --transpile flag with Babel for production use.
Use 'npm install decafjs -g' to install globally, or run via 'npx decafjs'.
Run 'npm install -g decafjs' or use 'npx decafjs'.
Run 'npm install decafjs' in your project directory.
Ensure you require/import the default export: const decaf = require('decafjs');