make-json-to-env 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -0
- package/package.json +19 -3
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# make-json-to-env 🚀
|
|
2
|
+
|
|
3
|
+
A lightweight CLI tool to transform your `JSON` configuration files into `.env` templates instantly. Perfect for generating `.env.example` files without manual typing.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 📦 Installation
|
|
8
|
+
|
|
9
|
+
You can run it directly without installing using `npx`:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npx make-json-to-env <filename.json>
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Or install it globally to use the command anywhere:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install -g make-json-to-env
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 🛠 Usage
|
|
24
|
+
|
|
25
|
+
Once installed, use the `convert-json-env` command followed by your JSON file:
|
|
26
|
+
|
|
27
|
+
### Basic Conversion
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
convert-json-env config.json
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
*This will create a `config.env` file in the same directory.*
|
|
35
|
+
|
|
36
|
+
### With a Prefix
|
|
37
|
+
|
|
38
|
+
Use the `--prefix` flag to prepend strings to every line (useful for shell scripts or specific frameworks).
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
convert-json-env firebaseConfig.json --prefix="export "
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## 📋 Example
|
|
48
|
+
|
|
49
|
+
**Input (`example.json`):**
|
|
50
|
+
|
|
51
|
+
```json
|
|
52
|
+
{
|
|
53
|
+
"apiKey": "12345",
|
|
54
|
+
"authDomain": "app.firebaseapp.com",
|
|
55
|
+
"projectId": "my-app"
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Command:**
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
convert-json-env example.json --prefix="export "
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Output (`example.env`):**
|
|
68
|
+
|
|
69
|
+
```env
|
|
70
|
+
export APIKEY=
|
|
71
|
+
export AUTHDOMAIN=
|
|
72
|
+
export PROJECTID=
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## ✨ Features
|
|
79
|
+
|
|
80
|
+
* **No Dependencies:** Light as a feather, uses native Node.js modules.
|
|
81
|
+
* **Smart Naming:** Automatically generates the output filename based on your input.
|
|
82
|
+
* **Case Formatting:** Automatically converts keys to `UPPER_CASE` for standard `.env` compliance.
|
|
83
|
+
* **Security First:** Helps you create `.env.example` files so you never accidentally commit your real secrets.
|
package/package.json
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "make-json-to-env",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Generates a template .env.example from a config.json file",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"make-json-to-env": "./index.js"
|
|
8
8
|
},
|
|
9
|
-
"keywords": [
|
|
9
|
+
"keywords": [
|
|
10
|
+
"env",
|
|
11
|
+
"json",
|
|
12
|
+
"converter",
|
|
13
|
+
"template",
|
|
14
|
+
"dot-env",
|
|
15
|
+
"environment-variables",
|
|
16
|
+
"config-to-env",
|
|
17
|
+
"cli",
|
|
18
|
+
"devtools",
|
|
19
|
+
"automation",
|
|
20
|
+
"boilerplate",
|
|
21
|
+
"env-example",
|
|
22
|
+
"dotenv-generator",
|
|
23
|
+
"configuration",
|
|
24
|
+
"secrets-management"
|
|
25
|
+
],
|
|
10
26
|
"author": "Your Name",
|
|
11
27
|
"license": "MIT"
|
|
12
|
-
}
|
|
28
|
+
}
|