🔎 List a directory (lisdir). Perhaps load its modules too?
yarn add lisdir
# If you're using NPM:
# npm install lisdir
import { listDirectory, listModules } from 'lisdir';
const entries = await listDirectory('./some/directory', {
filter: (entry) => file.isFile(),
recursive: true
});
const modules = await listModules('./some/directory', {
filter: (entry) => entry.name.startsWith('foo'),
recursive: true,
extensions: ['js']
});
lffg and contributors.
MIT License, see the included MIT file.