effect icon indicating copy to clipboard operation
effect copied to clipboard

FileSystem.glob

Open jessekelly881 opened this issue 1 year ago • 1 comments

It would be nice to have an @effect/platform native file glob similar to https://www.npmjs.com/package/glob that could be used w/ any FileSystem implementation.

(Bun has a built in implementation https://bun.sh/docs/api/glob)

jessekelly881 avatar Apr 06 '24 18:04 jessekelly881

+1 to this. Untill then (BYO error handling):

import fg from 'fast-glob'

export const glob = (path: string) => (cwd: string) => Effect.tryPromise({
  try: () => fg(path, { cwd }),
  catch: (cause) => createFilesystemError(`Glob Error`, { cause })
})

Nicholaiii avatar May 09 '24 05:05 Nicholaiii