Node.js 計算目錄內檔案數量
IPFS
//using fs
fs = require('fs');
console.log((fs.readdirSync('../json/')).length);
//using shelljs
shell = require('shelljs');
console.log((shell.ls('../json/')).length);
Original link: Phanix's Blog
喜欢我的作品吗?别忘了给予支持与赞赏,让我知道在创作的路上有你陪伴,一起延续这份热忱!
