yu-node
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -5,12 +5,12 @@ const fs = require('fs'); | ||
exports.getAllFiles = (dirPath, recursion=true) => { | ||
let arr = []; | ||
const bool = fs.existsSync(dirPath); //判断目录是否存在 | ||
if(!bool) return; | ||
let arr = []; | ||
if(!bool) return arr; | ||
dirPath = path.resolve(dirPath); | ||
(function fn(dirPath){ | ||
const dirents = fs.readdirSync(dirPath,{ withFileTypes:true }); | ||
dirents.forEach(dirent=>{ | ||
let child = path.join(dirPath,dirent.name); | ||
@@ -20,3 +20,3 @@ if(dirent.isDirectory()){ | ||
}else{ | ||
arr.push(path.resolve(child)); | ||
arr.push(child); | ||
} | ||
@@ -23,0 +23,0 @@ }); |
{ | ||
"name": "yu-node", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "仅用于node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
3111
53