Skip to content

Instantly share code, notes, and snippets.

View tejasrr19's full-sized avatar
🐢

Tejas Rao tejasrr19

🐢
View GitHub Profile
## What does this PR do?
## Where should the reviewer start?
## How should this be manually tested?
## Any background context you want to provide?
## What are the relevant tickets?

Keybase proof

I hereby claim:

  • I am tejasrr19 on github.
  • I am tejasrr19 (https://keybase.io/tejasrr19) on keybase.
  • I have a public key ASBoFMzobbVr7wEzAZiqsdWTfPBGCWVeciobVitwArRmMgo

To claim this, I am signing this object:

@tejasrr19
tejasrr19 / allFiles.js
Created April 10, 2017 17:21
List all Files in a Directory including files in Subdirectories.
const allRoutes = ((routeDir, routes) => {
const routeFiles = fs.readdirSync(routeDir);
routes = routes || [];
routeFiles.forEach((file) => {
if(fs.statSync(routeDir + file).isDirectory()) {
routes = allRoutes(routeDir + file + '/', routes);
} else {
routes.push(file);
}
});