@siguici/envig v0.0.0
π @siguici/envig β Unified Configuration and Environment Manager for Bun/TypeScript
Envig is a lightweight and flexible configuration
and environment manager for TypeScript,
designed to work seamlessly with Bun.
It unifies configuration loading from .env
files and JSON/TOML files,
and supports dynamic variable expansion.
π Features
β
Load configuration from JSON or TOML files dynamically
β
Support for environment variables via .env
files
β
Dynamic variable expansion (${VAR_NAME}
style)
β
Load from directories, single files, or raw text
β
Fallback and default values for missing keys
β
Type-safe retrieval with automatic conversion
β
Lightweight and fast, built specifically for Bun
π¦ Installation
With Bun:
bun add @siguici/envig
Or clone the repository:
git clone https://github.com/siguici/envig-ts.git envig
cd envig
bun install
βοΈ Usage
Envig provides a powerful unified interface combining environment and configuration:
πΉ From a Single File
import { envig } from "@siguici/envig";
const config = await envig("config.toml");
console.log(config.get("database.host"));
πΉ From a Directory
const config = await envig("config");
console.log(config.get("app.debug"));
πΉ From Raw Text
const toml = `
host = "localhost"
port = 5432
`;
const config = await envig(toml);
console.log(config.get("database.port"));
ποΈ Roadmap
- Support for YAML configuration formats
- CLI tool for managing environment variables
- Integration with popular logging tools
- Node.js compatibility (future)
π€ Contributing
Feel free to submit issues, ideas, or pull requests! Letβs build something great together.
π License
Envig is released under the MIT License.
β Show Your Support
If you like Envig, give it a β on GitHub!
Enjoy seamless configuration management with Envig! π
1 month ago