Skip to content

Instantly share code, notes, and snippets.

@clutchski
Created December 12, 2011 01:38
Show Gist options
  • Save clutchski/1464118 to your computer and use it in GitHub Desktop.
Save clutchski/1464118 to your computer and use it in GitHub Desktop.
print coffee script tokens with metadata
#!/usr/bin/env node
var fs = require('fs');
var path = require('path');
var CoffeeScript = require('coffee-script');
var file = process.argv[2];
var source = fs.readFileSync(file).toString()
var tokens = CoffeeScript.tokens(source);
tokens.forEach(function (token) {
console.log(token);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment