title: Why doesn't 'fs' work when imported as an ES6 module?
body: <p>Why do I get errors like these when I try to use the new Node.js support for ES6 modules (e.g. with <code>node --experimental-modules script.mjs</code>)?</p>
  
  <pre><code>// script.mjs
  import * as fs from 'fs';
  
  // TypeError: fs.readFile is not a function
  fs.readFile('data.csv', 'utf8', (err, data) =&gt; {
      if (!err) {
          console.log(data);
      }
  });
  // TypeError: fs.readdirSync is not a function
  fs.readdirSync('.').forEach(fileName =&gt; {
      console.log(fileName);
  });
  </code></pre>