Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Dec 3, 2017
1 parent da9a82b commit 4c8cd86
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ Configure `java-dotenv` once in your application.
```kotlin
val dotenv = Dotenv
.configure()
.directory("./src/test/resources")
.ignoreIfMalformed()
.directory("./") // set to the current directory
.ignoreIfMalformed() // do not throw an error if .env is malformed
.ignoreIfMissing() // do not throw an error if .env is missing
.build()
```

Expand Down Expand Up @@ -74,6 +75,19 @@ Note, environment variables specified in `.env` take precedence over those confi
dotenv.get("MY_ENV_VAR1");
```

## Configuration options

### *required* `directory(path: String)`
`path` specifies the directory containing `.env`. Dotenv first searches for `.env` using the given path on the filesystem. If not found it searches the given path on the classpath.

### *optional* `ignoreIfMalformed()`

Do not throw when `.env` entries are malformed. Malformed entries are skipped.

### *optional* `ignoreIfMissing()`

Do not throw when `.env` does not exist. Dotenv will continue to retrieve environment variables that are set in the environment e.g. `dotenv["HOME"]`

## License

[Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)

0 comments on commit 4c8cd86

Please sign in to comment.