yini-cli 1.0.1-beta.1 → 1.0.3-beta
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 +78 -11
- package/package.json +2 -2
- package/sample.yini +5 -5
package/README.md
CHANGED
|
@@ -11,25 +11,92 @@
|
|
|
11
11
|
- **YINI is an alternative** to other great config formats like INI, JSON, YAML, XML, and TOML — designed for clarity, simplicity, and straightforward section nesting.
|
|
12
12
|
- **Started as a personal project and a research challenge:** Provides structure similar to INI, with features inspired by JSON and YAML.
|
|
13
13
|
- **Built for clarity:**
|
|
14
|
-
* Uses
|
|
15
|
-
* Uses a concise syntax, aims to not have too much syntax noise.
|
|
14
|
+
* Uses concise syntax designed for clarity, especially in nested sections.
|
|
16
15
|
* Supports commonly used configuration structures.
|
|
17
|
-
- *
|
|
16
|
+
- *Developed to meet practical needs, driven by curiosity and a desire **for configuration clarity, simplicity, minimalism, and flexibility**.
|
|
18
17
|
|
|
19
18
|
---
|
|
20
19
|
|
|
21
20
|
## 💡 What is YINI?
|
|
22
21
|
- **INI-inspired** — with added support for typing, comments, and nested sections.
|
|
23
|
-
- **Uses minimal syntax** —
|
|
22
|
+
- **Uses minimal syntax** — yet aims to keep maximum clarity.
|
|
24
23
|
- Section nesting **without requiring indentation or dot-delimited keys**.
|
|
25
24
|
- **Supports strict and lenient modes**, and all major data types.
|
|
26
25
|
- Designed for compatibility with both **manual editing** and **automation**.
|
|
27
|
-
- 👉 See [how YINI
|
|
26
|
+
- 👉 See [how YINI differs from JSON, YAML, INI, and TOML](https://github.com/YINI-lang/yini-parser-typescript/tree/main/examples/compare-formats.md).
|
|
28
27
|
- Want the full syntax reference? See the [YINI Specification](https://github.com/YINI-lang/YINI-spec).
|
|
29
28
|
|
|
30
29
|
---
|
|
31
30
|
|
|
32
|
-
##
|
|
31
|
+
## Quick Into to YINI Format
|
|
32
|
+
|
|
33
|
+
YINI code looks like this:
|
|
34
|
+
```yini
|
|
35
|
+
// This is a comment in YINI
|
|
36
|
+
// YINI is a simple, human-readable configuration file format.
|
|
37
|
+
|
|
38
|
+
// Note: In YINI, spaces and tabs don't change meaning - indentation is just
|
|
39
|
+
// for readability.
|
|
40
|
+
|
|
41
|
+
/* This is a block comment
|
|
42
|
+
|
|
43
|
+
In YINI, section headers use repeated characters "^" at the start to
|
|
44
|
+
show their level: (Section header names are case-sensitive.)
|
|
45
|
+
|
|
46
|
+
^ SectionLevel1
|
|
47
|
+
^^ SectionLevel2
|
|
48
|
+
^^^ SectionLevel3
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
^ App // Definition of section (group) "App"
|
|
52
|
+
name = 'My Title' // Keys and values are written as key = value
|
|
53
|
+
items = 25
|
|
54
|
+
darkMode = true // "ON" and "YES" works too
|
|
55
|
+
|
|
56
|
+
// Sub-section of the "App" section
|
|
57
|
+
^^ Special
|
|
58
|
+
primaryColor = #336699 // Hex number format
|
|
59
|
+
isCaching = false // "OFF" and "NO" works too
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**The above YINI converted to a JS object:**
|
|
63
|
+
```js
|
|
64
|
+
{
|
|
65
|
+
App: {
|
|
66
|
+
name: 'My Title',
|
|
67
|
+
items: 25,
|
|
68
|
+
darkMode: true,
|
|
69
|
+
Special: {
|
|
70
|
+
primaryColor: 3368601,
|
|
71
|
+
isCaching: false
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
**In JSON:**
|
|
78
|
+
```json
|
|
79
|
+
{
|
|
80
|
+
"App":{
|
|
81
|
+
"name":"My Title",
|
|
82
|
+
"items":25,
|
|
83
|
+
"darkMode":true,
|
|
84
|
+
"Special":{
|
|
85
|
+
"primaryColor":3368601,
|
|
86
|
+
"isCaching":false
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
That's it!
|
|
93
|
+
|
|
94
|
+
- ▶️ Link to [examples/](https://github.com/YINI-lang/yini-parser-typescript/tree/main/examples) files.
|
|
95
|
+
- ▶️ Link to [Demo Apps](https://github.com/YINI-lang/yini-demo-apps/tree/main) with complete basic usage.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Bigger Intro into YINI Config Format
|
|
33
100
|
**YINI** is a simple and readable configuration format. Sections are defined with `^ SectionName`, and values are assigned using `key = value`. The format supports common data types (same as those found in JSON), including strings, numbers, booleans, nulls, and lists.
|
|
34
101
|
|
|
35
102
|
To learn more, see the [Getting Started: Intro to YINI Config Format](https://github.com/YINI-lang/YINI-spec/blob/develop/Docs/Intro-to-YINI-Config-Format.md) tutorial.
|
|
@@ -40,7 +107,7 @@ To learn more, see the [Getting Started: Intro to YINI Config Format](https://gi
|
|
|
40
107
|
|
|
41
108
|
### Installation
|
|
42
109
|
|
|
43
|
-
1. **Install it globally from npm**
|
|
110
|
+
1. **Install it globally from npm — (requires Node.js)**
|
|
44
111
|
Open your terminal and run:
|
|
45
112
|
```
|
|
46
113
|
npm install -g yini-cli
|
|
@@ -63,10 +130,10 @@ To learn more, see the [Getting Started: Intro to YINI Config Format](https://gi
|
|
|
63
130
|
Create a simple test file, for example: `config.yini`:
|
|
64
131
|
```yini
|
|
65
132
|
^ App
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
133
|
+
name = "My App Title"
|
|
134
|
+
version = "1.2.3"
|
|
135
|
+
pageSize = 25
|
|
136
|
+
darkTheme = off
|
|
70
137
|
```
|
|
71
138
|
|
|
72
139
|
Then run:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yini-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3-beta",
|
|
4
4
|
"description": "CLI for parsing and validating YINI config files: type-safe values, nested sections, comments, minimal syntax noise, and optional strict mode.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yini",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"author": "Marko K. Seppänen",
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"commander": "^14.0.0",
|
|
71
|
-
"yini-parser": "^1.0
|
|
71
|
+
"yini-parser": "^1.1.0-beta"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@eslint/js": "^9.31.0",
|
package/sample.yini
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
Example of a YINI document.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
^ Service
|
|
7
|
+
^ Service // Defines a section named Service.
|
|
8
8
|
Enabled = true
|
|
9
9
|
|
|
10
|
-
^^ Cache
|
|
11
|
-
Type = "redis"
|
|
10
|
+
^^ Cache // Defines Cache, a sub-section of Server.
|
|
11
|
+
Type = "redis"
|
|
12
12
|
TTL = 3600
|
|
13
13
|
|
|
14
|
-
^^^ Options
|
|
14
|
+
^^^ Options // Defines Options, a sub-section of Cache.
|
|
15
15
|
Host = "127.0.0.1"
|
|
16
16
|
Port = 6379
|
|
17
17
|
|
|
18
|
-
^ Env
|
|
18
|
+
^ Env // Defines a section named Env.
|
|
19
19
|
code = "dev"
|