0.0.0 β€’ Published 1 month ago

@siguici/envig v0.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

🌟 @siguici/envig – Unified Configuration and Environment Manager for Bun/TypeScript

License Bun

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! πŸš€