const fs = require('fs')
const files = fs.readdirSync('./')
files.forEach((file,index) => {
let newName = `work-${file}`
fs.rename(`./${file}`, `./${newName}`, (err) => {
if(!err) {
console.log(newName + '已重命名!')
}
})
})
08-09
490
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-18
1138
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-30