More concise way to convert an array of files into object, using the filename as key
<p>I'm using Node.js to load an array of files from a folder and create an array of objects:</p>

<pre><code>var files = {}
fs.readdirSync(dir).forEach(function(file) {
    files[file] = fs.readFileSync(dir + '/' + file)
})
</code></pre>

<p>This seems like I should be able to do this without defining the object first, using <code>.map()</code> maybe?</p>