Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

123456789101112
  1. const fs = require('fs-extra');
  2. exports.isEmpty = (path) => {
  3. try {
  4. let stat = fs.statSync(path);
  5. if (!stat.isDirectory()) return true;
  6. let items = fs.readdirSync(path);
  7. return !items || !items.length;
  8. } catch (e) {
  9. return true;
  10. }
  11. }