Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Carmine DiMascio committed Mar 2, 2019
1 parent f6439c9 commit 2a552fd
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ Use `dotenv.get("...")` instead of Java's `System.getenv(...)`.
<dependency>
<groupId>io.github.cdimascio</groupId>
<artifactId>java-dotenv</artifactId>
<version>4.0.1</version>
<version>4.1.0</version>
</dependency>
```

### Gradle

```groovy
compile 'io.github.cdimascio:java-dotenv:4.0.1'
compile 'io.github.cdimascio:java-dotenv:4.1.0'
```

## Usage
Expand Down Expand Up @@ -135,6 +135,27 @@ dotenv["HOME"]
dotenv["MY_ENV_VAR1"] ?: "default value"
```

### Iterate over environment variables
Note, environment variables specified in the host environment take precedence over those in `.env`.

With **Java**

```java
for (DotenvEntry e : dotenv.entries()) {
System.out.println(e.getKey());
System.out.println(e.getValue());
}
```

or with **Kotlin**

```kotlin
for (e in dotenv.entries()) {
println(e.key)
println(e.value)
}
```

## Configuration options

### *optional* `directory`
Expand Down

0 comments on commit 2a552fd

Please sign in to comment.