dotenv-extended-prepare v1.2.6
dotenv-extended-prepare
Just run it on a cloned repo, and .env preset will be sitting in the top-level directory for you to fill it.
.env is created based on
.env.defaultsand.env.schema
Preview
NODE_ENV=
# PORT=
# npm_package_name=
TOKEN=Variables from
.env.defaultsare taken as optional — commented out with#on line start.The
.env.schemavariables definitely want you to fill them in.
Quick start
For personal usage
Simply run it after cloning another genius repo telling you to scrap around the files looking for variable names
npx dotenv-extended-prepareFor automatically respecting the time of other developers
- Install
dotenv-extended-prepareas a development dependency:
npm i -D dotenv-extended-prepare- Specify a
postinstallscript in your package file — it will run onnpm ie.g.
"scripts": { "postinstall": "dotenv-extended-prepare" }in package.json
npm set-script postinstall "dotenv-extended-prepare"TODO
If you need to specify a custom path or name to schemas/defaults, or you don't use
dotenv-extendedat all, or you prefer using regular OGdotenvlike our grandpas did and your env sample is named.env.example— just wait a couple of days. I'm planning to add more names for auto-search and some configuration.
Experimental
Auto-generate .env.schema if a repo doesn't specify one
In the future, we could make it also generate .env.defaults
npx dotenv-extended-prepare generateWhy?
I like high development convenience. Almost every new project has its .env schemas/examples/samples or defaults. Usually, after cloning a new repository, the developer has to not just enter environment variables, but also search for their names, check which ones are already set by default and create an .env file.
This package is actively maintained. Give it a star, and maybe share some thoughts by opening an issue.
Caught a Bug?
- Fork this repository to your own GitHub account and then clone it to your local device
- Link the package to the global module directory:
npm link - Within the Node app you want to test your local development instance of dotenv-extended-prepare, just link it to the dependencies:
npm link dotenv-extended-prepare(Skip this step if you're using it vianpxonly). Instead of the default one from npm, Node.js will now use your clone of the tool!
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago