Buckets:
| import { join } from 'path' | |
| import fs from 'fs/promises' | |
| import type { Dirent, StatsBase } from 'fs' | |
| export async function getFilesInDir(path: string): Promise<Set<string>> { | |
| const dir = await fs.opendir(path) | |
| const results = new Set<string>() | |
| for await (const file of dir) { | |
| let resolvedFile: Dirent | StatsBase<number> = file | |
| if (file.isSymbolicLink()) { | |
| resolvedFile = await fs.stat(join(path, file.name)) | |
| } | |
| if (resolvedFile.isFile()) { | |
| results.add(file.name) | |
| } | |
| } | |
| return results | |
| } | |
Xet Storage Details
- Size:
- 531 Bytes
- Xet hash:
- ed7599b35c9d1a923aa7467be800f503b35fbdded34963b18c92a341381e5cea
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.