title: How do I setup Babel 6 with Node JS to use ES6 in my Server Side code?
body: <p>I have read several times the documentation provided at :
  <a href="https://babeljs.io/docs/setup/#node" rel="noreferrer">Node API Babel 6 Docs</a></p>
  
  <p>I'm starting out learning pg-promise following the Learn by Example tutorial and would prefer to work with ES6 and transpile to ES5 with Babel but am unsure of a few things :</p>
  
  <ol>
  <li>After installing babel-core, what preset do I use and where/how do I configure this to work?</li>
  </ol>
  
  <p>The documentation was unclear to me about which file I put:  <strong>require("babel-core").transform("code", options);</strong>  into and what parts of that code are place holders.  When I use that code, do I just use it one time somewhere and then I can use ES6 in every other file?  How would this be achieved?</p>
  
  <ol start="2">
  <li><p>I read about this .babelrc file and would like to confirm if the actual filename is ".babelrc" or if that is just the file extension and where in relation to the root directory of my project do I put that file.. and how do I link to it?</p></li>
  <li><p>If I'm using <a href="https://github.com/vitaly-t/pg-promise#pg-promise" rel="noreferrer">pg-promise</a> should I be using ES6 and Babel or will running : npm install as described under the <strong>Testing</strong> section for pg-promise be enough and trying to use ES6 with this create more problems?</p></li>
  </ol>
  
  <p>I was hoping to take advantage of let and const if the need came up during my server side development.</p>
  
  <ol start="4">
  <li>Is there a standard file structure for a node+babel+pg-promise server setup?</li>
  </ol>
  
  <p><strong>Edit</strong>
  Worth noting that I have also read <a href="https://stackoverflow.com/questions/28782656/how-to-run-node-js-app-with-es6-features-enabled">Node JS with Babel-Node</a> and saw that using this should be avoided.  The final answer at the very bottom didn't really make sense to me for similar reasons I'm having trouble following the actual documentation provided by Babel.</p>