Created
April 26, 2016 19:17
-
-
Save kripod/5aeb53358858714ceffce39c335f81ad to your computer and use it in GitHub Desktop.
Node.js - ES6 directory selector
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nodeVersion = parseInt(process.versions.node.split('.')[0]); | |
if (nodeVersion >= 6) { | |
// Use the untranspiled ES6 code | |
require('./src'); | |
} else { | |
// Use the transpiled ES5 code | |
require('./lib'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment