Skip to content

kayibea/dotenv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dotenv Parser

A simple Lua module to load environment variables from a .env file.

Installation

You can install the dotenv module using LuaRocks:

luarocks install dotenv

Usage

require "dotenv".config()

print(os.getenv("MY_VARIABLE")) 
print(os.getenv("ANOTHER_VARIABLE")) 

Example .env file

MY_VARIABLE=HelloWorld
ANOTHER_VARIABLE=42

License

This project is licensed under the MIT License. See the LICENSE file for details.

Features

  • Loads environment variables from a .env file.
  • Supports comments and blank lines.
  • Handles quoted values.
  • Automatically trims whitespace around keys and values.
  • Supports multi-line values.

About

A simple Lua module to load environment variables from a .env file.

Topics

Resources

Stars

Watchers

Forks

Languages