Here is the xk6-dotenv v0.2.0 version, which is a simplified extension version.
The direct k6 dependency is removed, so it will build with any k6 version. The price of independence of the k6 version is that the JavaScript API has also been removed. Using the JavaScript API to manipulate environment variables in a test script is not a good practice anyway.