Skip to content

Instantly share code, notes, and snippets.

@ahomu
Created November 25, 2014 07:43
Show Gist options
  • Save ahomu/052cf780e182a8322b18 to your computer and use it in GitHub Desktop.
Save ahomu/052cf780e182a8322b18 to your computer and use it in GitHub Desktop.
var input = process.argv[2];
var compiler = require('coffee-script-redux');
var fs = require('fs');
var escodegen = require('escodegen');
var data = fs.readFileSync(input, {encoding: 'utf-8'});
var tokens = compiler.parse(data);
var ast = compiler.compile(tokens);
var output = escodegen.generate(ast);
console.log(output);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment