#home-dir #home #directory #path #light-weight #performance

simple-home-dir

Effortlessly retrieve the user's home directory (cross-platform)

18 releases

new 0.4.6 Jan 14, 2025
0.4.5 Dec 2, 2024
0.4.4 Nov 5, 2024
0.4.0 Jul 20, 2024
0.1.1 Mar 31, 2023

#244 in Filesystem

Download history 968/week @ 2024-09-24 1066/week @ 2024-10-01 1020/week @ 2024-10-08 1247/week @ 2024-10-15 515/week @ 2024-10-22 471/week @ 2024-10-29 683/week @ 2024-11-05 412/week @ 2024-11-12 602/week @ 2024-11-19 1349/week @ 2024-11-26 1102/week @ 2024-12-03 947/week @ 2024-12-10 831/week @ 2024-12-17 1030/week @ 2024-12-24 851/week @ 2024-12-31 1363/week @ 2025-01-07

4,195 downloads per month
Used in 19 crates (17 directly)

MIT license

5KB

simple-home-dir

Crate

A minimal, fast, and reliable crate dedicated to retrieving the user's home directory.

Usage

use simple_home_dir::*;

fn main() {
    // Windows  =>  C:\Users\jdoe
    // Linux    =>  /home/jdoe
    // Mac      =>  /Users/jdoe
    let path = home_dir().unwrap();
}

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
~54K SLoC