+19
| let dirfile = require('./index'); | ||
| let path = require('path'); | ||
| const dirpath = 'd:/ader/ader'; | ||
| const async = false; | ||
| const deep = true; | ||
| const extname = 'sql'; | ||
| let fileArr = dirfile(dirpath,async,deep,function(filePath,stat){ | ||
| var ext = path.extname(filePath).toLowerCase(), | ||
| extArr = extname.split(',').map(item=>{ | ||
| return item.startsWith('.') ? item : '.'+item; | ||
| }).join(','); | ||
| return ext != '' && extArr.toLowerCase().indexOf(ext) > -1; | ||
| },function(filePath,stat){ | ||
| return filePath; | ||
| }); | ||
| console.log(fileArr.length); |
+1
-1
| { | ||
| "name": "dirfile", | ||
| "version": "1.0.1", | ||
| "version": "1.0.2", | ||
| "description": "获取文件夹内所有的文件。支持递归获取、异步或同步、过滤、返回信息处理。", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
8867
6.86%5
25%123
13.89%