title: Better to export an object containing function, or just export multiple functions in ES6 (Is there a convention?)
body: <p>This is a question of convention. I'm new to ES6 but I'm trying to make use of the module system. Is preferred/more common to export multiple functions from a single file, or export a single object containing these functions.</p>
  
  <p>Example:</p>
  
  <p><strong>utils.js</strong></p>
  
  <pre><code>export function add(num1, num2) {
    return num1 + num2;
  }
  
  export function minus(num1, num2) {
    return num1 - num2;
  }
  </code></pre>
  
  <p>and use it like this:</p>
  
  <pre><code>import {add, minus} from 'utils.js';
  </code></pre>
  
  <p>vs </p>
  
  <p><strong>utils.js</strong></p>
  
  <pre><code>const utils = {
    add: (num1, num2) =&gt; {
      return num1 + num2;
    },
  
    minus: (num1, num2) =&gt; {
      return num1 - num2;
    }
  }
  
  export default utils;
  </code></pre>
  
  <p>In a utils file that contains a 50-100 functions, it seems the second way would be the clear winner. But there's just something that feels wrong about it to me, and I don't know why.</p>