import { fileSystemService } from 'services' ; import { resolve } from 'path' ; async param { String } directory private param { String [ ] } files returns { Promise < string [ ] > } example export async function getAllFiles ( directory , files = [ ] ) { const { readDir , fileStatus } = fileSystemService ( ) ; const dir = await readDir ( directory ) ; for ( const file of dir ) { const absolute = resolve ( directory , file ) ; const isDir = ( await fileStatus ( absolute ) ) . isDirectory ( ) ; if ( isDir ) { await getAllFiles ( absolute , files ) ; } else { files . push ( absolute ) ; } } return files ; }