#home-dir #home #directory #user #retrieving

deprecated simple-home-dir

Deprecated: This crate is no longer necessary as Rust now provides an official home_dir() method. Use std::env::home_dir() instead.

20 releases

0.5.0 Feb 27, 2025
0.4.6 Jan 14, 2025
0.4.5 Dec 2, 2024
0.4.4 Nov 5, 2024
0.1.1 Mar 31, 2023

#10 in #home-dir

Download history 424/week @ 2024-11-08 546/week @ 2024-11-15 552/week @ 2024-11-22 1753/week @ 2024-11-29 1050/week @ 2024-12-06 843/week @ 2024-12-13 508/week @ 2024-12-20 1158/week @ 2024-12-27 999/week @ 2025-01-03 1680/week @ 2025-01-10 1194/week @ 2025-01-17 1038/week @ 2025-01-24 1080/week @ 2025-01-31 1304/week @ 2025-02-07 984/week @ 2025-02-14

3,560 downloads per month
Used in 19 crates (17 directly)

MIT license

3KB

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.

No runtime deps