dotenvpp-parser
Core .env file parser for DotenvPP.
This crate is no_std-compatible (with alloc) so it can be used
in WASM and embedded environments. Enable the std feature (on by
default) for std::error::Error implementations.
Features
KEY=VALUEbasic parsing with comment and blank-line handling- Single-quoted values (literal, multiline supported), double-quoted values (with escapes), and unquoted values
- Multiline values in single-quoted and double-quoted strings
export KEY=VALUEprefix support- Escape sequences:
\\,\",\n,\t,\r,\$ - Common unquoted escapes for spaces, quotes, dollar signs, and newlines
Example
use parse;
let input = "# Database config\nDB_HOST=localhost\nDB_PORT=5432\nSECRET='keep-it-safe'\n";
let pairs = parse.unwrap;
assert_eq!;
assert_eq!;
assert_eq!;