import {drawTree, map, FileSystem} from 'effect-tree'import {Effect, pipe} from 'effect'import {NodeContext, NodeRuntime} from '@effect/platform-node'import {Path} from '@effect/platform'const effect = Effect.gen(function* () { const path = yield* Path.Path // Goto src/fileSystem/fixtures const directory = path.join( import.meta.dirname, '..', '..', '..', 'src', 'fileSystem', 'fixtures', ) const tree = yield* FileSystem.readDirectoryTree(directory) const mapped = map(tree, ({name}) => name) const drawn = drawTree(mapped) expect(drawn).toEqual([ '┬fixtures ', '└┬directory ', ' ├─file ', ' └┬inner-directory', ' └─inner-file ' ])})pipe(effect, Effect.provide(NodeContext.layer), NodeRuntime.runMain) Copy
import {drawTree, map, FileSystem} from 'effect-tree'import {Effect, pipe} from 'effect'import {NodeContext, NodeRuntime} from '@effect/platform-node'import {Path} from '@effect/platform'const effect = Effect.gen(function* () { const path = yield* Path.Path // Goto src/fileSystem/fixtures const directory = path.join( import.meta.dirname, '..', '..', '..', 'src', 'fileSystem', 'fixtures', ) const tree = yield* FileSystem.readDirectoryTree(directory) const mapped = map(tree, ({name}) => name) const drawn = drawTree(mapped) expect(drawn).toEqual([ '┬fixtures ', '└┬directory ', ' ├─file ', ' └┬inner-directory', ' └─inner-file ' ])})pipe(effect, Effect.provide(NodeContext.layer), NodeRuntime.runMain)
Example