Add Babel as a dependency to your app's package.json file and define a start script:
{
"dependencies": {
"babel": "4.7.16"
},
"scripts": {
"start": "./node_modules/.bin/babel-node ./app.js"
}
}
Then you can simply execute the following command to run your app:
npm start
If you ever decide to stop using Babel (e.g. once Node.js supports all of the ES6/7 features), you can just update your package.json to the following:
{
"dependencies": {},
"scripts": {
"start": "node ./app.js"
}
}
One benefit of this is that the command to run your app remains the same, which helps if you are working with other developers.