Modules@robinpath/dotenv
@robinpath/dotenv
0.1.0PublicSecure .env file management with key validation, path restrictions, and protected system variables
@robinpath/dotenv
Secure .env file management with key validation, path restrictions, and protected system variables
Why use this module?
The dotenv module lets you:
- Parse a .env format string into an object
- Convert an object to .env format string
- Read a .env file and load values into process.env (won't override existing or protected vars by default)
- Read a .env file and return as object without modifying process.env
- Get a value from a .env file by key
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
npm install @robinpath/dotenv
Quick Start
No credentials needed — start using it right away:
dotenv.stringify $vars
Available Functions
| Function | Description |
|---|---|
dotenv.parse | Parse a .env format string into an object |
dotenv.stringify | Convert an object to .env format string |
dotenv.load | Read a .env file and load values into process.env (won't override existing or protected vars by default) |
dotenv.read | Read a .env file and return as object without modifying process.env |
dotenv.get | Get a value from a .env file by key |
dotenv.set | Set a key=value in a .env file |
dotenv.remove | Remove a key from a .env file |
dotenv.exists | Check if a .env file exists |
dotenv.keys | Return all keys from a .env file |
dotenv.expand | Expand variable references like ${VAR} in values (process.env fallback disabled by default) |
Examples
Convert an object to .env format string
dotenv.stringify $vars
Read a .env file and load values into process.env (won't override existing or protected vars by default)
dotenv.load ".env"
Read a .env file and return as object without modifying process.env
dotenv.read ".env.local"
Integration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/dotenv";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
dotenv.stringify $vars
`);
Full API Reference
See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.
Related Modules
@robinpath/json— JSON module for complementary functionality
License
MIT
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.0 | latest | yesterday |
Related Modules
utilities
1
@dev-tester/hello-world
v2.0.0dev-tester
Updated description
0 downloads
...
utilities
0
@robinpath/apollo
v0.1.1robinpath
Apollo module for RobinPath.
0 downloads
...
utilities
0
@robinpath/archive
v0.1.1robinpath
Create and extract .zip and .tar.gz file archives
0 downloads
...
utilities
0
@robinpath/assert
v0.1.1robinpath
Testing assertions: equal, deepEqual, truthy, falsy, type checks, includes, matches, throws, and more
0 downloads
...
Install
$ robinpath install @robinpath/dotenv Version0.1.0
LicenseMIT
Unpacked Size4.9 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

