Skip to content

Instantly share code, notes, and snippets.

@noyesa
Last active December 18, 2015 00:59
Show Gist options
  • Select an option

  • Save noyesa/5700701 to your computer and use it in GitHub Desktop.

Select an option

Save noyesa/5700701 to your computer and use it in GitHub Desktop.
var fs = require('fs');
if (process.argv.length < 3) {
console.log('JavaScript.js: the JavaScript to JavaScript transpiler.');
console.log('Please profile a source file.');
process.exit(1);
}
fs.readFile(process.argv[3], 'utf8', function(error, data) {
if (error) {
console.error(error.message);
process.exit(1);
}
console.log(data);
});
@noyesa
Copy link
Author

noyesa commented Jun 3, 2013

Huge milestone: JavaScript.js has become self-compiling.

anoyes-mn1:Desktop anoyes$ node JavaScript.js JavaScript.js
JavaScript.js: the JavaScript to JavaScript transpiler.
var fs = require('fs');
console.log('JavaScript.js: the JavaScript to JavaScript transpiler.');
if (process.argv.length < 3) {
console.log('Please profile a source file.');
process.exit(1);
}

fs.readFile(process.argv[1], 'utf8', function(error, data) {
if (error) {
console.error(error.message);
process.exit(1);
}

console.log(data);
});

anoyes-mn1:Desktop anoyes$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment