#env-var #path #global

globenv

Globally set & read environment variables and paths on Windows, macOS or Linux

3 unstable releases

0.2.1 Nov 22, 2023
0.2.0 Nov 5, 2023
0.1.0 Oct 16, 2023

#1147 in Configuration

Download history 91/week @ 2025-04-14 19/week @ 2025-04-21 16/week @ 2025-04-28 7/week @ 2025-05-05 13/week @ 2025-05-12 13/week @ 2025-05-26 1/week @ 2025-06-02 11/week @ 2025-06-16 34/week @ 2025-06-23 53/week @ 2025-06-30 9/week @ 2025-07-07 14/week @ 2025-07-14 3/week @ 2025-07-21 74/week @ 2025-07-28

100 downloads per month

Apache-2.0

11KB
232 lines

globenv

Globally set & read environment variables and paths (not just for the current process) on Windows, macOS or Linux

Version badge Downloads badge License badge

Example:

use globenv::*;

// Get environment variable
get_var("key").unwrap().unwrap();
// Set environment variable
set_var("key", "value").unwrap();
// Remove environment variable
remove_var("key").unwrap();

// Get all environment paths
get_paths().unwrap();
// Set environment path
set_path("example/path").unwrap();
// Remove environment path
remove_path("example/path").unwrap();

Credit:

Based on the globalenv by @nicolasbauw

Dependencies

~0–10MB
~49K SLoC