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

simple-home-dir

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

17 releases

0.4.5 Dec 2, 2024
0.4.4 Nov 5, 2024
0.4.3 Oct 3, 2024
0.4.0 Jul 20, 2024
0.1.1 Mar 31, 2023

#212 in Filesystem

Download history 1492/week @ 2024-08-21 1156/week @ 2024-08-28 1700/week @ 2024-09-04 1303/week @ 2024-09-11 935/week @ 2024-09-18 919/week @ 2024-09-25 1135/week @ 2024-10-02 903/week @ 2024-10-09 1253/week @ 2024-10-16 509/week @ 2024-10-23 512/week @ 2024-10-30 578/week @ 2024-11-06 447/week @ 2024-11-13 602/week @ 2024-11-20 1476/week @ 2024-11-27 842/week @ 2024-12-04

3,417 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–7.5MB
~55K SLoC