UNPKG

serverless

Version:

Serverless Framework - Build web, mobile and IoT applications with serverless architectures using AWS Lambda, Azure Functions, Google CloudFunctions & more

24 lines (19 loc) 529 B
'use strict'; const path = require('path'); const fs = require('fs'); function walkDirSync(dirPath) { let filePaths = []; const list = fs.readdirSync(dirPath); list.forEach((filePathParam) => { let filePath = filePathParam; filePath = path.join(dirPath, filePath); const stat = fs.statSync(filePath); if (stat && stat.isDirectory()) { filePaths = filePaths.concat(walkDirSync(filePath)); } else { filePaths.push(filePath); } }); return filePaths; } module.exports = walkDirSync;