Skip to content

Commit

Permalink
docs(readme): add immutable envConfig in README
Browse files Browse the repository at this point in the history
Add the immutable envConfig example with Object.freeze in README.md file

Signed-off-by: Niloy Sikdar <niloysikdar30@gmail.com>
  • Loading branch information
niloysikdar committed Oct 17, 2022
1 parent 739704a commit 0310ff7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,12 @@ Your generated file (`env.ts`) will look something like this (depending on the k
import { register } from 'neoenv';
register();

export const envConfig = {
export const envConfig = Object.freeze({
MONGODB_URI: String(process.env.MONGODB_URI),
GITHUB_CLIENT_ID: String(process.env.GITHUB_CLIENT_ID),
CLOUDINARY_API_KEY: String(process.env.CLOUDINARY_API_KEY),
JWT_SECRET: String(process.env.JWT_SECRET),
};
});
```

Neoenv will handle everything from loading the environment variables from the `.env` file to generating the configuration object based on the keys available in the `.env` file automatically so that you don't have to do anything manually with copy-paste and you can safely focus on building your application. 🚀
Expand Down

0 comments on commit 0310ff7

Please sign in to comment.