@dotenvx/dotenvx
Advanced tools
Comparing version 0.6.2 to 0.6.3
{ | ||
"version": "0.6.2", | ||
"version": "0.6.3", | ||
"name": "@dotenvx/dotenvx", | ||
@@ -4,0 +4,0 @@ "description": "a better dotenv–from the creator of `dotenv`", |
185
README.md
@@ -7,3 +7,3 @@ ![dotenvx](https://dotenvx.com/better-banner.png) | ||
* [multi-environment](#multiple-environments) | ||
* [encrypted envs](#encrypt-your-env-files) | ||
* [encrypted envs](#encryption) | ||
@@ -18,3 +18,3 @@ | ||
``` | ||
> * [other ways to install](#other-ways-to-install) | ||
> * [other ways to install](https://dotenvx.com/docs/install) | ||
@@ -41,3 +41,3 @@ | ||
```sh | ||
$ echo 'import os;print("Hello " + os.getenv("HELLO", ""))' > index.py | ||
$ echo "HELLO=World" > .env && echo 'import os;print("Hello " + os.getenv("HELLO", ""))' > index.py | ||
@@ -52,3 +52,3 @@ $ dotenvx run -- python3 index.py | ||
```sh | ||
$ echo '<?php echo "Hello {$_SERVER["HELLO"]}\n";' > index.php | ||
$ echo "HELLO=World" > .env && echo '<?php echo "Hello {$_SERVER["HELLO"]}\n";' > index.php | ||
@@ -63,3 +63,3 @@ $ dotenvx run -- php index.php | ||
```sh | ||
$ echo 'puts "Hello #{ENV["HELLO"]}"' > index.rb | ||
$ echo "HELLO=World" > .env && echo 'puts "Hello #{ENV["HELLO"]}"' > index.rb | ||
@@ -74,3 +74,3 @@ $ dotenvx run -- ruby index.rb | ||
```sh | ||
$ echo 'fn main() {let hello = std::env::var("HELLO").unwrap_or("".to_string());println!("Hello {hello}");}' > src/main.rs | ||
$ echo "HELLO=World" > .env && echo 'fn main() {let hello = std::env::var("HELLO").unwrap_or("".to_string());println!("Hello {hello}");}' > src/main.rs | ||
@@ -85,3 +85,3 @@ $ dotenvx run -- cargo run | ||
```sh | ||
$ echo 'public class Index { public static void main(String[] args) { System.out.println("Hello " + System.getenv("HELLO")); } }' > index.java | ||
$ echo "HELLO=World" > .env && echo 'public class Index { public static void main(String[] args) { System.out.println("Hello " + System.getenv("HELLO")); } }' > index.java | ||
@@ -98,3 +98,3 @@ $ dotenvx run -- java index.java | ||
$ cd HelloWorld | ||
$ echo 'Console.WriteLine($"Hello {Environment.GetEnvironmentVariable("HELLO")}");' > Program.cs && echo "HELLO=World" > .env | ||
$ echo "HELLO=World" > .env && echo 'Console.WriteLine($"Hello {Environment.GetEnvironmentVariable("HELLO")}");' > Program.cs && echo "HELLO=World" > .env | ||
@@ -203,3 +203,3 @@ $ dotenvx run -- dotnet run | ||
```sh | ||
$ echo "HELLO=production" > .env.production | ||
$ echo "HELLO=production" > .env.production && echo "console.log('Hello ' + process.env.HELLO)" > index.js | ||
@@ -272,7 +272,7 @@ $ dotenvx run --env-file=.env.production -- node index.js | ||
## Encrypt Your Env Files | ||
## Encryption | ||
> Encrypt your secrets to a `.env.vault` file. | ||
``` | ||
$ echo "HELLO=World" > .env | ||
$ echo "HELLO=World" > .env && echo "console.log('Hello ' + process.env.HELLO)" > index.js | ||
@@ -299,6 +299,13 @@ $ echo "HELLO=production" > .env.production | ||
[dotenvx][INFO] * share .env.keys file over secure channels only | ||
> :-] | ||
``` | ||
$ DOTENV_KEY='dotenv://:key_abc123@dotenvx.com/vault/.env.vault?environment=development' dotenvx run -- node index.js | ||
| ||
> Then load env from encrypted `.env.vault` file | ||
```sh | ||
$ DOTENV_KEY='dotenv://:key_abc123@dotenvx.com/vault/.env.vault?environment=production' dotenvx run -- node index.js | ||
[dotenvx][INFO] injecting 1 environment variable from encrypted .env.vault | ||
Hello World | ||
Hello production | ||
@@ -308,4 +315,105 @@ > :-] | ||
More examples | ||
* <details><summary>AWS Lambda</summary><br> | ||
```sh | ||
coming soon | ||
``` | ||
</details> | ||
* <details><summary>Digital Ocean</summary><br> | ||
```sh | ||
coming soon | ||
``` | ||
</details> | ||
* <details><summary>Docker</summary><br> | ||
```sh | ||
coming soon | ||
``` | ||
</details> | ||
* <details><summary>Fly.io</summary><br> | ||
```sh | ||
coming soon | ||
``` | ||
</details> | ||
* <details><summary>Heroku</summary><br> | ||
```sh | ||
coming soon | ||
``` | ||
</details> | ||
* <details><summary>Laravel Forge</summary><br> | ||
```sh | ||
coming soon | ||
``` | ||
</details> | ||
* <details><summary>Netlify</summary><br> | ||
```sh | ||
coming soon | ||
``` | ||
</details> | ||
* <details><summary>Railway</summary><br> | ||
```sh | ||
coming soon | ||
``` | ||
</details> | ||
* <details><summary>Render</summary><br> | ||
```sh | ||
coming soon | ||
``` | ||
</details> | ||
* <details><summary>Vercel</summary><br> | ||
```sh | ||
coming soon | ||
``` | ||
</details> | ||
* <details><summary>CircleCI</summary><br> | ||
```sh | ||
coming soon | ||
``` | ||
</details> | ||
* <details><summary>GitHub Actions</summary><br> | ||
```sh | ||
coming soon | ||
``` | ||
</details> | ||
| ||
--- | ||
## Usage | ||
@@ -385,56 +493,7 @@ | ||
## Install | ||
Installing with [`brew`](https://brew.sh) is most straight forward: | ||
```sh | ||
brew install dotenvx/brew/dotenvx | ||
``` | ||
### Other Ways to Install | ||
#### 1. global npm | ||
After `brew`, installing globally using [`npm`](https://www.npmjs.com/package/@dotenvx/dotenvx) is easiest: | ||
```sh | ||
npm install @dotenvx/dotenvx --global | ||
``` | ||
#### 2. local npm | ||
Or install in your `package.json`: | ||
```sh | ||
npm i @dotenvx/dotenvx --save | ||
``` | ||
```json | ||
{ | ||
"scripts": { | ||
"start": "./node_modules/.bin/dotenvx run -- node index.js" | ||
}, | ||
"dependencies": { | ||
"@dotenvx/dotenvx": "^0.6.0" | ||
} | ||
} | ||
``` | ||
#### 3. standalone binary | ||
Or download it directly as a standalone binary: | ||
```sh | ||
# download it to `/user/local/bin/dotenvx` | ||
curl -fsS https://dotenvx.sh/ | sh | ||
# check it works | ||
dotenvx help | ||
``` | ||
## Contributing | ||
If you have questions or feedback: | ||
You can fork this repo and create [pull requests](https://github.com/dotenvx/dotenvx/pulls) or if you have questions or feedback: | ||
* [github.com/dotenvx/dotenvx](https://github.com/dotenvx/dotenvx/issues) - bugs and discussions | ||
* [@dotenvx 𝕏](https://x.com/dotenvx) (DMs are open) |
@@ -213,5 +213,5 @@ #!/usr/bin/env node | ||
let keysData = `#/!!!!!!!!!!!!!!!!!!!.env.keys!!!!!!!!!!!!!!!!!!!!!!/ | ||
#/ DOTENV_KEYs. DO NOT commit to source control / | ||
#/ [how it works](https://dotenv.org/env-keys) / | ||
#/--------------------------------------------------/\n` | ||
#/ DOTENV_KEYs. DO NOT commit to source control / | ||
#/ [how it works](https://dotenv.org/env-keys) / | ||
#/--------------------------------------------------/\n` | ||
@@ -218,0 +218,0 @@ for (const key in dotenvKeys) { |
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
28243
487