yo-next-auth/lib/server.ts
2024-04-26 22:16:21 +03:00

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)
}