yini-cli 1.3.4-beta → 1.3.4
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 +47 -52
- package/dist/index.js +2 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
# YINI
|
|
1
|
+
# YINI CLI
|
|
2
2
|
> **Readable configuration without indentation pitfalls or JSON verbosity.**
|
|
3
3
|
|
|
4
|
-
**The official
|
|
4
|
+
**The official CLI for validating, inspecting, and converting YINI configuration files to JSON or JavaScript, built by the YINI-lang project.**
|
|
5
5
|
|
|
6
|
-
*YINI is an INI-inspired
|
|
6
|
+
*YINI is an INI-inspired, human-friendly configuration format with real structure, nested sections, comments, and predictable parsing.*
|
|
7
7
|
|
|
8
8
|
[](https://www.npmjs.com/package/yini-cli) [](https://github.com/YINI-lang/yini-cli/actions/workflows/run-all-tests.yml) [](https://github.com/YINI-lang/yini-cli/actions/workflows/run-regression-tests.yml) [](https://github.com/YINI-lang/yini-cli/actions/workflows/run-cli-test.yml) [](https://www.npmjs.com/package/yini-cli)
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
## Example of YINI code
|
|
15
|
-
> A basic YINI configuration example, showing a section, nested section, comments:
|
|
16
|
-

|
|
17
|
-
Source: [basic.yini](./samples/basic.yini)
|
|
10
|
+
Designed for developers and teams who want human-edited configuration with explicit structure and no indentation-based semantics.
|
|
18
11
|
|
|
19
12
|
## Quick Start
|
|
20
13
|
|
|
@@ -23,7 +16,7 @@ YINI CLI requires Node.js **v20 or later**.
|
|
|
23
16
|
|
|
24
17
|
### Installation
|
|
25
18
|
|
|
26
|
-
1. **Install
|
|
19
|
+
1. **Install globally from npm — (requires Node.js)**
|
|
27
20
|
Open your terminal and run:
|
|
28
21
|
```
|
|
29
22
|
npm install -g yini-cli
|
|
@@ -34,22 +27,22 @@ YINI CLI requires Node.js **v20 or later**.
|
|
|
34
27
|
```bash
|
|
35
28
|
yini --version
|
|
36
29
|
```
|
|
37
|
-
This should print the installed version
|
|
30
|
+
This should print the installed version.
|
|
38
31
|
|
|
39
|
-
Then
|
|
32
|
+
Then try:
|
|
40
33
|
```bash
|
|
41
34
|
yini --help
|
|
42
35
|
```
|
|
43
|
-
|
|
36
|
+
This should show the CLI help.
|
|
44
37
|
|
|
45
38
|
3. **Test functionality**
|
|
46
39
|
Create a simple test file, for example: `config.yini`:
|
|
47
40
|
```yini
|
|
48
41
|
^ App
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
name = "My App Title"
|
|
43
|
+
version = "1.2.3"
|
|
44
|
+
pageSize = 25
|
|
45
|
+
darkTheme = off
|
|
53
46
|
```
|
|
54
47
|
|
|
55
48
|
Then run:
|
|
@@ -57,7 +50,7 @@ YINI CLI requires Node.js **v20 or later**.
|
|
|
57
50
|
yini parse config.yini
|
|
58
51
|
```
|
|
59
52
|
|
|
60
|
-
Expected
|
|
53
|
+
Expected output:
|
|
61
54
|
```json
|
|
62
55
|
{
|
|
63
56
|
"App": {
|
|
@@ -77,7 +70,12 @@ YINI CLI requires Node.js **v20 or later**.
|
|
|
77
70
|
|
|
78
71
|
---
|
|
79
72
|
|
|
80
|
-
##
|
|
73
|
+
## What YINI looks like
|
|
74
|
+
> A basic YINI configuration example, showing a section, nested section, comments:
|
|
75
|
+

|
|
76
|
+
Source: [basic.yini](./samples/basic.yini)
|
|
77
|
+
|
|
78
|
+
### A larger example
|
|
81
79
|
> A real-world YINI configuration example, showing sections, nesting, comments, and multiple data types:
|
|
82
80
|

|
|
83
81
|
Source: [config.yini](./samples/config.yini)
|
|
@@ -86,10 +84,10 @@ Source: [config.yini](./samples/config.yini)
|
|
|
86
84
|
|
|
87
85
|
## 🙋♀️ Why YINI?
|
|
88
86
|
- **Indentation-independent structure:** YINI is indentation-independent — whitespace never alters structural meaning.
|
|
89
|
-
- **Explicit nesting
|
|
90
|
-
- **Multiple data types:** Supports
|
|
91
|
-
- **
|
|
92
|
-
- **Predictable parsing
|
|
87
|
+
- **Explicit nesting:** It uses clear header markers (`^`, `^^`, `^^^`) to define hierarchy, making large configurations easier to scan and refactor.
|
|
88
|
+
- **Multiple data types:** Supports booleans (`true` / `false`, `yes` / `no`, etc.), numbers, lists, and inline objects, with explicit string syntax.
|
|
89
|
+
- **Comment support:** YINI supports multiple comment styles (`#`, `//`, `/* ... */`, and `;`), making it easier to document configuration directly in the file.
|
|
90
|
+
- **Predictable parsing:** Well-defined rules with optional strict and lenient modes for different use cases.
|
|
93
91
|
|
|
94
92
|
---
|
|
95
93
|
|
|
@@ -130,7 +128,7 @@ yini parse --help
|
|
|
130
128
|
|
|
131
129
|
---
|
|
132
130
|
|
|
133
|
-
##
|
|
131
|
+
## A closer look at YINI
|
|
134
132
|
|
|
135
133
|
Here's a small example showing YINI structure and comments:
|
|
136
134
|
```yini
|
|
@@ -149,7 +147,7 @@ Here's a small example showing YINI structure and comments:
|
|
|
149
147
|
# This is a comment too.
|
|
150
148
|
```
|
|
151
149
|
|
|
152
|
-
**The above YINI
|
|
150
|
+
**The above YINI as a JavaScript object:**
|
|
153
151
|
```js
|
|
154
152
|
{
|
|
155
153
|
App: {
|
|
@@ -201,9 +199,7 @@ The `parse` command supports multiple output formats:
|
|
|
201
199
|
>💡 `--js` and `--compact` are mutually exclusive.
|
|
202
200
|
>💡 Tip: You can combine --output with any style flag to control both formatting and destination.
|
|
203
201
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
## 📁 Output File Handling
|
|
202
|
+
### Output File Handling
|
|
207
203
|
|
|
208
204
|
When using `-o, --output <file>`, YINI CLI applies safe write rules:
|
|
209
205
|
|
|
@@ -211,45 +207,44 @@ When using `-o, --output <file>`, YINI CLI applies safe write rules:
|
|
|
211
207
|
|----------|--------|
|
|
212
208
|
| File does not exist | File is written |
|
|
213
209
|
| File exists and is **older** than the input YINI file | File is overwritten |
|
|
214
|
-
| File exists and is **newer** than the input YINI file |
|
|
210
|
+
| File exists and is **newer** than the input YINI file | Skipped by default |
|
|
211
|
+
| File exists and output content is unchanged | Skipped |
|
|
215
212
|
| `--overwrite` is used | File is always overwritten |
|
|
216
213
|
| `--no-overwrite` is used | Command fails if file exists |
|
|
217
214
|
|
|
218
|
-
This
|
|
215
|
+
This helps avoid overwriting newer generated files and avoids rewriting unchanged output unnecessarily.
|
|
219
216
|
|
|
220
|
-
Use
|
|
221
|
-
`--overwrite` to force replacement.
|
|
217
|
+
Use `--overwrite` to force replacement.
|
|
222
218
|
|
|
223
219
|
---
|
|
224
220
|
|
|
225
|
-
##
|
|
226
|
-
|
|
221
|
+
## Links
|
|
222
|
+
- ➡️ [YINI Homepage](https://yini-lang.org)
|
|
223
|
+
*Tutorials, guides, and examples.*
|
|
227
224
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
3. Command `format`: Pretty-print or normalize a `.yini` file.
|
|
231
|
-
4. Command `lint`: Stricter stylistic checks (like `validate`, but opinionated).
|
|
232
|
-
5. Command `diff`: Compare two YINI files and show structural/config differences.
|
|
233
|
-
6. Import JSON or XML into YINI format.
|
|
225
|
+
- ➡️ [Read the YINI Specification](https://yini-lang.org/refs/specification)
|
|
226
|
+
*Full syntax and format reference.*
|
|
234
227
|
|
|
235
|
-
---
|
|
236
|
-
|
|
237
|
-
## Links
|
|
238
228
|
- ➡️ [YINI Parser on npm](https://www.npmjs.com/package/yini-parser)
|
|
239
|
-
*
|
|
229
|
+
*The TypeScript/Node.js parser used by this CLI.*
|
|
240
230
|
|
|
241
|
-
- ➡️ [
|
|
242
|
-
*
|
|
231
|
+
- ➡️ [Demo Apps](https://github.com/YINI-lang/yini-demo-apps/tree/main)
|
|
232
|
+
*Complete basic usage examples.*
|
|
233
|
+
|
|
234
|
+
- ➡️ [YINI-lang Project](https://github.com/YINI-lang)
|
|
235
|
+
*Repositories and related ecosystem projects.*
|
|
243
236
|
|
|
244
237
|
---
|
|
245
238
|
|
|
246
|
-
##
|
|
247
|
-
Contributions,
|
|
239
|
+
## Contributing
|
|
240
|
+
Contributions, bug reports, and feedback are welcome. Even small improvements or suggestions are appreciated.
|
|
241
|
+
|
|
242
|
+
If this tool is useful to you, a GitHub star helps more people discover the project and supports future development.
|
|
248
243
|
|
|
249
244
|
---
|
|
250
245
|
|
|
251
246
|
## License
|
|
252
|
-
This project is licensed under the Apache-2.0 license
|
|
247
|
+
This project is licensed under the Apache-2.0 license — see the [LICENSE](./LICENSE) file for details.
|
|
253
248
|
|
|
254
249
|
In this project on GitHub, the `libs` directory contains third party software and each is licensed under its own license which is described in its own license file under the respective directory under `libs`.
|
|
255
250
|
|
|
@@ -258,4 +253,4 @@ In this project on GitHub, the `libs` directory contains third party software an
|
|
|
258
253
|
**^YINI ≡**
|
|
259
254
|
> Readable like INI. Structured like JSON. No indentation surprises.
|
|
260
255
|
|
|
261
|
-
[yini-lang.org](https://yini-lang.org/?utm_source=github&utm_medium=referral&utm_campaign=yini_cli&utm_content=readme_footer) · [YINI on GitHub](https://github.com/YINI-lang)
|
|
256
|
+
[yini-lang.org](https://yini-lang.org/?utm_source=github&utm_medium=referral&utm_campaign=yini_cli&utm_content=readme_footer) · [YINI-lang on GitHub](https://github.com/YINI-lang)
|
package/dist/index.js
CHANGED
|
@@ -52,10 +52,10 @@ program.addHelpText('after', getHelpTextAfter());
|
|
|
52
52
|
*/
|
|
53
53
|
// Suggestions for future: --verbose, --debug, --no-color, --color, --timing, --stdin
|
|
54
54
|
program
|
|
55
|
-
.option('
|
|
55
|
+
.option('--strict', 'Enable strict parsing mode.')
|
|
56
56
|
// .option('-f, --force', 'Continue parsing even if errors occur.')
|
|
57
57
|
.option('-q, --quiet', 'Reduce output (show only errors).')
|
|
58
|
-
.option('--silent', 'Suppress all output (even errors, exit code only).')
|
|
58
|
+
.option('-s, --silent', 'Suppress all output (even errors, exit code only).')
|
|
59
59
|
.option('--verbose', 'Display extra information.')
|
|
60
60
|
.action((options) => {
|
|
61
61
|
debugPrint('Run global options');
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yini-cli",
|
|
3
|
-
"version": "1.3.4
|
|
4
|
-
"description": "CLI
|
|
3
|
+
"version": "1.3.4",
|
|
4
|
+
"description": "Official YINI CLI for validating, parsing, and converting a human-friendly config format with real structure, nested sections, and predictable strict or lenient parsing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yini",
|
|
7
7
|
"cli",
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"parser",
|
|
12
12
|
"validator",
|
|
13
13
|
"ini",
|
|
14
|
-
"
|
|
14
|
+
"command",
|
|
15
15
|
"json",
|
|
16
16
|
"command-line",
|
|
17
17
|
"yaml",
|
|
18
18
|
"xml",
|
|
19
|
-
"
|
|
19
|
+
"cli-tool"
|
|
20
20
|
],
|
|
21
21
|
"type": "module",
|
|
22
22
|
"main": "dist/index.js",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"commander": "^14.0.1",
|
|
73
73
|
"xmlbuilder2": "^4.0.3",
|
|
74
74
|
"yaml": "^2.8.2",
|
|
75
|
-
"yini-parser": "^1.4.3
|
|
75
|
+
"yini-parser": "^1.4.3"
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@eslint/js": "^9.31.0",
|