Skip to content

Commit

Permalink
feat: supporting CLI use
Browse files Browse the repository at this point in the history
  • Loading branch information
mrsteele committed Jan 21, 2020
1 parent e9ba93e commit 7e7a52b
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 @@ -45,15 +45,15 @@ console.log(process.env.EMAIL)
// Outputs: [email protected]
```

### Using it with TypeScript
##### TypeScript
Since this module does not provide TypeScript Type Definitions if you try to import it like `import dotenv from "dotenv-defaults"` TypeScript will return an error.

Instead you should load it like this:
```typescript
import "dotenv-defaults/config"
```

### Using it as a CLI
##### CLI
You can also call this module directly when using the node executable.
So, for example if you are running a custom script with node and you want to load your environment variables you can do the following `node -r dotenv-defaults/config your-script.js`. (_When using this method, please make sure that you have installed dotenv-defaults with npm or yarn in the same directory_)

Expand Down

0 comments on commit 7e7a52b

Please sign in to comment.