env-create
Advanced tools
Comparing version 1.1.0 to 1.1.1
{ | ||
"name": "env-create", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Read in a .env.json file that contains valid JSON and assign top level properties to environment variables", | ||
@@ -45,2 +45,2 @@ "repository": { | ||
"dependencies": {} | ||
} | ||
} |
@@ -41,3 +41,3 @@ # env-create | ||
The `load()` method will create a process environment variable for every top level object in the the default `.env.json` file located at the root of your project. The `load()` method optionally takes a JSON object with properties for `path, debug,` and `encoding`. All three properties are optional. | ||
The `load()` method will create a process environment variable for every top level object in the the default `.env.json` file located at the root of your project. The `load()` method optionally takes a JSON object with properties for `path`, and `encoding`. Both properties are optional. The function returns an array of messages. If an environment variable already existed and would have been overwritten there were will be a message letting you know that. | ||
@@ -49,3 +49,5 @@ ## Option usage | ||
```javascript | ||
require('env-create').load({path: "../ENV_VARS/gsweet.env.json", encode: "utf8", debug: "true"});) | ||
require('env-create').load({ | ||
path: "../ENV_VARS/gsweet.env.json", | ||
encode: "utf8")) | ||
const firstSecret = JSON.parse(process.env.secret1); | ||
@@ -58,3 +60,5 @@ const secondSecret = JSON.parse(process.env.secret2); | ||
```javascript | ||
require('env-create').load({path: "/User/yourUserName/ENV_VARS/gsweet.env.json", encode: "utf8", debug: "true"});) | ||
const result = require('env-create').load({ | ||
path: "/User/yourUserName/ENV_VARS/gsweet.env.json", | ||
encode: "utf8")) | ||
``` | ||
@@ -61,0 +65,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19756
66