text: const path = require('path');
  const fs = require('fs');
  
  fs.promises.rmdir(__dirname +'\\files-copy', { recursive: true });
  fs.promises.mkdir(__dirname +'\\files-copy');
  
  
  async function copyDirectory() {
    try {
      fs.readdir(__dirname +'\\files', { withFileTypes: true }, (err, files) => {
          
          if (err) console.log(err);
          
          else {
            files.forEach(file => {
              fs.copyFile(path.join(__dirname +'\\files', file.name), 
              path.join(__dirname + '/files-copy', file.name), (err) => {
                if (err) console.log(err);
              });
            }
            );
          }
        });
  
    } catch (err) { console.log(err); }
  
  }
  copyDirectory();
  