Skip to content

Commit

Permalink
update README.md file
Browse files Browse the repository at this point in the history
  • Loading branch information
ramin-deriv committed Nov 20, 2023
1 parent 65a2456 commit 142ff85
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/deriv_env/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ You can check if the environment variable is initialized using the `isInitialize
bool isInitialized = Env().isInitialized;
```

### Loading environment variables
### Initializing the Env

Before using any environment variables, you need to load them from a file. The `load` method loads the variables from a file with the specified filename (default is `.env`).
Before using any environment variables, you need to intialize the `Env` class and pass it an instnace of the EnvLoader and the path to the file. The `initialize` method loads the variables from a file with the specified filename (default is `.env`).

```dart
await Env().load();
await Env().initialize(EnvLoader(), '.env');
```

The load method expects the file to contain key-value pairs separated by an equals sign (`=`) and each pair separated by a newline character (`\n`). Blank lines and comments (lines starting with a `#`) are ignored.
Expand Down

0 comments on commit 142ff85

Please sign in to comment.