chomens-bot-js/util/file-list.js

14 lines
258 B
JavaScript
Raw Normal View History

2022-08-14 05:51:45 -04:00
const fs = require('fs/promises')
async function list (filepath = '.') {
const files = await fs.readdir(filepath)
const component = []
files.forEach((filename, index) => {
component.push(filename)
})
return component
}
module.exports = list