1.0.9 • Published 5 months ago
@teeny-tiny/dotenv v1.0.9
A teeny-tiny dotenv parser
require("@teeny-tiny/dotenv").config(
/* Options:
- path [default = "./.env"]: of the dotenv file
- executeCode [default = false]: evaluate code contained in < code > brackets; do NOT activate unless necessary
*/
);
Values get parsed as json. Use // or # for comments in the dotenv file. As a perfectly parsable example:
VERSION="1.0.9" // --> "1.0.9"
NAME="@teeny-tiny/dotenv" // --> "@teeny-tiny/dotenv"
PRODUCT_NAME="Tenny Tiny Dotenv Parser" // --> "Tenny Tiny Dotenv Parser"
MATH=< 1 + 1 > // --> "2" <-- process.env only accepts strings; requires activated "executeCode" option
Credits
Thanks to the dotenv team for the inspiration. Use their package dotenv for a fully-fledged dotenv parser.