Thanks to visit codestin.com
Credit goes to github.com

Skip to content

vistuleB/dirtree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dirtree

Package Version Hex Docs

gleam add dirtree@1

A directory tree abstraction including a pretty-printer.

import dirtree

pub fn main() -> Nil {
  let tree = dirtree.from_terminals(
    "../examples",
    [
      "futuristic/pngs/png2.png",
      "futuristic/svgs/svg2.png",
      "futuristic/svgs/svg1.png",
      "notes/README.md",
      "futuristic/pngs/png1.png",
      "empty-directory/",
    ],
  )

  tree
  |> dt.pretty_print(1)
  |> string.join("\n")
  |> io.println

  // ->
  //
  // ../examples
  //    ├─ empty-directory
  //    ├─ futuristic
  //    │  ├─ pngs
  //    │  │  ├─ png1.png
  //    │  │  └─ png2.png
  //    │  └─ svgs
  //    │     ├─ svg1.png
  //    │     └─ svg2.png
  //    └─ notes
  //       ├─ README.md
  //       └─ old-README.md
}

Further documentation can be found at https://hexdocs.pm/dirtree.

Development

gleam run   # Run the project
gleam test  # Run the tests

About

Gleam package for pretty-printing directory trees.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages