10 lines
247 B
TypeScript
10 lines
247 B
TypeScript
'use server'
|
|
|
|
import { readdir } from 'fs/promises'
|
|
|
|
export const getDirectories = async (source: string) => {
|
|
return (await readdir(source, { withFileTypes: true }))
|
|
.filter(dirent => dirent.isDirectory())
|
|
.map(dirent => dirent.name)
|
|
}
|