directories

A lightweight gleam package to get standard locations of directories for temporary files, config, cache, etc.

Package Version Hex Docs

gleam add directories@1
import directories

pub fn main() {
  // All functions return an Result(String, Nil)
  // Nil will be returned whenever it couldn't find a valid directory
  let tmp_dir = io.debug(directories.tmp_dir())
  let home_dir = io.debug(directories.home_dir())
  let cache_dir = io.debug(directories.cache_dir())
  let config_dir = io.debug(directories.config_dir())
  let config_local_dir = io.debug(directories.config_local_dir())
  let data_dir = io.debug(directories.data_dir())
  let data_local_dir = io.debug(directories.data_local_dir())
  let executable_dir = io.debug(directories.executable_dir())
  let preferences_dir = io.debug(directories.preferences_dir())
  let runtime_dir = io.debug(directories.runtime_dir())
  let state_dir = io.debug(directories.state_dir())
}

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

Dependencies

TODO

Development

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