mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-12-02 07:05:39 -05:00
19 lines
351 B
JavaScript
19 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
|