Node.js copy files from several directories to one directory
<p>How to copy files from several directories to one directory with Node.js.
Provided that there are several directories in one directory.</p>

<p>I have a solution</p>

<pre><code>var fs = require('fs');
var ncp = require('ncp').ncp;
ncp.limit = 16;
fs.readdir(__dirname, function(err, files) {
    for (var i = 0; i &lt; files.length; i++) {
        ncp(files[i], 'C:/Users/User/Desktop/output', function(err) {
            if (err) {
                return console.error(err);
            }
            console.log('done!');
        });
    }
});
</code></pre>

<p>But it may be possible to make it better?</p>