motdotla/dotenv — reverse-engineered prompt
Reverse engineered prompt
Build me a small Node library that reads a .env file and puts the values into process.env as early as possible in an app. I want it to feel like dotenv, really simple to use with require('dotenv').config() and also import 'dotenv/config' for ESM. It should load from the current app folder by default, let me pass a custom path and a couple of basic options like encoding or debug, and include a parse function that can take a string or Buffer and return an object.
Please make the parser handle quoted values, comments, hashes inside quotes, and multiline secrets like private keys. Include good tests and a clear README with examples for a basic app and a monorepo style folder setup. If people ask for variable expansion, encryption, or multiple environment files, just point them toward dotenvx instead of building all of that here. Look up current docs online if you need to.
Want more depth? Deep Reverse