The interactivity is not the only helpful feature, you can use comments in .env files to help the end user understand what values are expected as these comments will be displayed during the setup flow. If you do not provide a comment, a helpful description will be autogenerated using the default/example value.
The easiest way to use this package is to run it (Duh). You can add a `configure` script to your package.json file that runs `dotenv-generator`. If you want users to execute this script let them know by asking them to perform this after installation `npm explore {name_of_the_package} -- npm run configure`.
Ideally your project should use `dotenv-generator --postinstall` as a `postinstall` action. This means that after installation of your package, `dotenv-generator` will be run. This allows for a seamless setup of your project that will magically happen after installation. Since this is not an ideal world npm 6+ *doesn't play nice* with interactive `postinstall` hooks so I've added a check for that if you include the `--postinstall` flag it will check the npm version and for npm 6+ the script won't execute the interactive flow.It will instead print a message saying that the configuration could be done by executing `npm explore {name_of_the_package} -- npm run postinstall`. To view this output you must include `--foreground-scripts` as a flag for package installation ie. `npm i --foreground-scripts`.
The project is fully open sourced here https://github.com/lnenad/dotenv-generator