15 unstable releases (3 breaking)

0.4.3 Oct 3, 2024
0.4.0 Jul 20, 2024
0.3.2 Jan 21, 2024
0.2.1 Dec 27, 2023
0.1.1 Mar 31, 2023

#151 in Filesystem

Download history 1071/week @ 2024-07-04 1317/week @ 2024-07-11 1657/week @ 2024-07-18 2085/week @ 2024-07-25 2251/week @ 2024-08-01 2327/week @ 2024-08-08 1655/week @ 2024-08-15 1414/week @ 2024-08-22 1139/week @ 2024-08-29 1903/week @ 2024-09-05 1075/week @ 2024-09-12 979/week @ 2024-09-19 894/week @ 2024-09-26 1246/week @ 2024-10-03 799/week @ 2024-10-10 1120/week @ 2024-10-17

4,225 downloads per month
Used in 18 crates (15 directly)

MIT license

5KB

simple-home-dir

Crate

An extremely tiny and reliable Rust library purposed to retrieve the user's home directory.

Usage

use simple_home_dir::*;

fn main() {
    // Windows => "C:\Users\<USER>"
    // Linux   => "/home/<USER>"
    // Mac     => "/Users/<USER>"
    let path = home_dir().unwrap();
    println!("{:?}", path)
}

Features

The expand_tilde feature is available here.

Testing

The dirs crate is relied upon to ensure that the functions of this crate are working properly.

Credit

The majority of the Windows portion has been noted from the windows-sys and directories crates.

Dependencies

~0–8MB
~61K SLoC