title: How to use ES6 computed property names in node / iojs?
body: <p>I am trying to write a tool that takes a CSV and dynamically generates a definition based on the header row?</p>
  
  <p>For example, a CSV with:</p>
  
  <pre><code>Title(STRING), Description(TEXT)
  Title Example, Description Example
  ...
  </code></pre>
  
  <p>the Sequelize <a href="http://docs.sequelizejs.com/en/latest/docs/models-definition/#definition" rel="nofollow">docs</a> specify, for example:</p>
  
  <pre><code>var Entry = sequelize.define('Entry', {
    title: Sequelize.STRING,
    description: Sequelize.TEXT
  })
  </code></pre>
  
  <p>How could I write this definition so that it could be dynamically defined - so that <code>title</code> and the data type <code>Sequelize.STRING</code> could be dynamically generated based on the CSV header row?</p>
  
  <hr>
  
  <p><strong>EDIT</strong></p>
  
  <p>Ok, after some research, I think the obvious question is "How to use variable names as dynamic key names in object literal" and has been answered several times.</p>
  
  <p>As a result, it is simple to write this in bracket notation so:</p>
  
  <pre><code>var definitionObj = {}
  definitionObj['title'] = sequelize.STRING;
  definitionObj['description'] = sequelize.TEXT;
  
  var Entry = sequelize.define('Entry', definitionObj);
  </code></pre>
  
  <p>However, then my question now is <strong>how do I use ES6 <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer#Computed_property_names" rel="nofollow">Computed Property Names</a> in node</strong>? I'm using node 0.12.2 which I thought had ES6 support, and even with the <code>--harmony</code> flag, this simple code fails:</p>
  
  <pre><code>var Entry = sequelize.define('Entry', {
    ['title']: Sequelize.STRING,
    ['description']: Sequelize.TEXT
  });
  </code></pre>
  
  <p>with <code>SyntaxError: Unexpected token [</code></p>
  
  <p>Is the only option really to go to with <a href="http://iojs.org" rel="nofollow">io.js</a>?</p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>Actually this syntax still fails even with iojs, so I must be doing something wrong?</p>