yz-dome
v1.0.0
Published
```js const fs = require('fs'); class ReadFile{ constructor (options){ Object.assign(this,{},options); const inof = fs.statSync(this.pathDir); if(inof.isFile()){ const a = fs.readFileSync(this.pathDir,'utf-8'
Downloads
1
Readme
杨招小dome
const fs = require('fs');
class ReadFile{
constructor (options){
Object.assign(this,{},options);
const inof = fs.statSync(this.pathDir);
if(inof.isFile()){
const a = fs.readFileSync(this.pathDir,'utf-8');
console.log(a);
}else{
const arr = fs.readdirSync(this.pathDir);
arr.forEach(item=>{
item = this.pathDir + "/" + item;
const a = fs.readFileSync(item,'utf-8');
console.log(a);
})
}
}
}
new ReadFile({
pathDir:'dome01'
})