with glob you could do glob("**/*.js", { cwd: __dirname }...