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