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 5e06b1a commit b9f456f
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,6 @@ Configure `java-dotenv` once in your application. (see below for [Java](#configu
val dotenv = Dotenv.configure().build()
```

or with options:

```kotlin
val dotenv = Dotenv
.configure()
.directory("./some/path") // set the directory containing .env
.ignoreIfMalformed() // do not throw an error if .env is malformed
.ignoreIfMissing() // do not throw an error if .env is missing
.build()
```

see [configuration options](#configuration-options)

### Get environment variable
Expand All @@ -71,16 +60,6 @@ Configure `java-dotenv` once in your application.
Dotenv dotenv = Dotenv.configure().build();
```

or with options:

```java
Dotenv dotenv = Dotenv.Instance
.configure()
.directory("./src/test/resources")
.ignoreIfMalformed()
.build();
```

see [configuration options](#configuration-options)

### Get environment variables
Expand All @@ -103,6 +82,30 @@ Do not throw when `.env` entries are malformed. Malformed entries are skipped.

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"]`

## Configuration Examples

### Kotlin

```kotlin
val dotenv = Dotenv
.configure()
.directory("./some/path") // set the directory containing .env
.ignoreIfMalformed() // do not throw an error if .env is malformed
.ignoreIfMissing() // do not throw an error if .env is missing
.build()
```

### Java 8

```java
Dotenv dotenv = Dotenv.Instance
.configure()
.directory("./src/test/resources")
.ignoreIfMalformed()
.build();
```


## License

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

0 comments on commit b9f456f

Please sign in to comment.