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'
})
yz-dome
1.0.0 • Public • PublishedReadme
Keywords
nonePackage Sidebar
Install
npm i yz-dome
Weekly Downloads
3
Version
1.0.0
License
ISC
Unpacked Size
2.15 kB
Total Files
5