yo-next-auth/lib/server.ts

8 lines
237 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)
}