mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
18 lines
357 B
JavaScript
18 lines
357 B
JavaScript
const fs = require('fs/promises')
|
|
|
|
/**
|
|
* just list the files
|
|
* @param {String} filepath file path
|
|
* @return {Array} component.
|
|
*/
|
|
async function list (filepath = '.') {
|
|
const files = await fs.readdir(filepath)
|
|
|
|
const component = []
|
|
files.forEach((filename, index) => {
|
|
component.push(filename)
|
|
})
|
|
return component
|
|
}
|
|
|
|
module.exports = list
|