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 |
- const fs = require('fs-extra');
-
- exports.isEmpty = (path) => {
- try {
- let stat = fs.statSync(path);
- if (!stat.isDirectory()) return true;
- let items = fs.readdirSync(path);
- return !items || !items.length;
- } catch (e) {
- return true;
- }
- }
|