From 7e7a52b272a022624972b03544b09cfa3ac16596 Mon Sep 17 00:00:00 2001 From: mrsteele Date: Tue, 21 Jan 2020 09:39:37 -0500 Subject: [PATCH] feat: supporting CLI use --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3ebe8fe..9a79e01 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ console.log(process.env.EMAIL) // Outputs: test@email.com ``` -### 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: @@ -53,7 +53,7 @@ Instead you should load it like this: 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_)