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

simple-home-dir

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

16 releases

0.4.4 Nov 5, 2024
0.4.2 Sep 11, 2024
0.4.0 Jul 20, 2024
0.3.2 Jan 21, 2024
0.1.1 Mar 31, 2023

#200 in Filesystem

Download history 1828/week @ 2024-07-29 2677/week @ 2024-08-05 1582/week @ 2024-08-12 1570/week @ 2024-08-19 1188/week @ 2024-08-26 1799/week @ 2024-09-02 1344/week @ 2024-09-09 864/week @ 2024-09-16 969/week @ 2024-09-23 1090/week @ 2024-09-30 1047/week @ 2024-10-07 1232/week @ 2024-10-14 580/week @ 2024-10-21 486/week @ 2024-10-28 693/week @ 2024-11-04 362/week @ 2024-11-11

2,167 downloads per month
Used in 19 crates (16 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
~60K SLoC