-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
mrsteele
committed
Jan 21, 2020
1 parent
e9ba93e
commit 7e7a52b
Showing
1 changed file
with
2 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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_) | ||
|
||
|