Skip to content

Instantly share code, notes, and snippets.

@crissilvaeng
Created August 26, 2018 23:34
Show Gist options
  • Save crissilvaeng/d0fcfae93a8a6a7148ccebf083030e23 to your computer and use it in GitHub Desktop.
Save crissilvaeng/d0fcfae93a8a6a7148ccebf083030e23 to your computer and use it in GitHub Desktop.
const load = protos => {
const dirname = path.join(__dirname, config.rpc.protos)
return fs.readdirSync(dirname)
.reduce((accum, curr) => {
if (curr.endsWith('.proto') == true) {
const proto = path.join(__dirname, config.rpc.protos, curr)
return [...accum, proto]
}
}, [])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment