Skip to content

Instantly share code, notes, and snippets.

@jonlong
Last active September 2, 2015 16:43
Show Gist options
  • Save jonlong/9061aa14c0d0b2efc42c to your computer and use it in GitHub Desktop.
Save jonlong/9061aa14c0d0b2efc42c to your computer and use it in GitHub Desktop.
How to Use ES2015 with Node.js, For Regulars
/**
* ES6 looks awesome! Hey, and Node 0.12 supports a ton of features!
*
* ::HOURS LATER::
*
* In strict mode only!
*
* ::HOURS LATER::
*
* The docs say modules are supported! Let's convert everything now!
*
* ::HOURS LATER::
*
* Actually no, the docs just list the flag as a reference for what
* you'd use *once modules are officially supported*.
*
* God dammit.
*
* ::HOURS LATER::
*
* Babel! Turn that frown upside down by transpiling our code into an
* ES6 environment!
*
* ::HOURS LATER::
*
* Babel doesn't transpile the file it's required from. Sure.
*
* Anyways, I guess this is the entry point into our app now. Enjoy your
* fuckin fat arrows, or whatever.
*
* I'm moving into the woods.
*
* Christ almighty.
*/
require('babel/register');
module.exports = require('./src/server');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment