FridayNightFunkinBoyfriendBot/ChomensJS/util/file-list.js

19 lines
351 B
JavaScript
Raw Normal View History

2023-12-17 14:55:27 -05:00
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