yu-node
Advanced tools
Comparing version 1.0.2 to 1.0.3
const fs = require('fs'); | ||
const path = require('path'); | ||
exports.getAllFiles = dir => { | ||
let dirPath = path.join(__dirname,dir); | ||
exports.getAllFiles = dirPath => { | ||
const bool = fs.existsSync(dirPath); //判断目录是否存在 | ||
@@ -24,2 +23,4 @@ if(!bool) return; | ||
return arr; | ||
} | ||
} | ||
exports.getAllFiles('./lib'); |
@@ -22,4 +22,3 @@ const fs = require('fs'); | ||
exports.emptyDir = dir => { | ||
let dirPath = path.join(__dirname,dir); | ||
exports.emptyDir = dirPath => { | ||
const bool = fs.existsSync(dirPath); //判断目录是否存在 | ||
@@ -32,4 +31,3 @@ if(!bool) return; | ||
exports.rmDir = dir => { | ||
let dirPath = path.join(__dirname,dir); | ||
exports.rmDir = dirPath => { | ||
const bool = fs.existsSync(dirPath); //判断目录是否存在 | ||
@@ -36,0 +34,0 @@ if(!bool) return; |
{ | ||
"name": "yu-node", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "仅用于node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
3117
55