mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-13 18:34:54 -05:00
508b6a64c7
i see its faster so i use it
18 lines
351 B
JavaScript
18 lines
351 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 = []
|
|
for (const filename of files) {
|
|
component.push(filename)
|
|
}
|
|
return component
|
|
}
|
|
|
|
module.exports = list
|