yini-parser 1.4.3-beta → 1.4.3
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/CHANGELOG.md +3 -0
- package/README.md +59 -141
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 1.4.3 - 2026 Apr
|
|
4
|
+
- **Fixed:** Rebuilt the project and reduced reported vulnerabilities from 4 to 0.
|
|
5
|
+
|
|
3
6
|
## 1.4.3-beta - 2026 Mar
|
|
4
7
|
- **Fixed:** Error messages and thrown parse errors now include correct line and column information again.
|
|
5
8
|
- **Improved:** Syntax and string-related parse errors are now clearer and more consistent.
|
package/README.md
CHANGED
|
@@ -1,145 +1,68 @@
|
|
|
1
|
-
#
|
|
2
|
-
> **Readable configuration without YAML foot-guns or JSON noise.**
|
|
1
|
+
# yini-parser
|
|
2
|
+
> **Readable configuration for Node.js and TypeScript — without YAML foot-guns or JSON noise.**
|
|
3
3
|
|
|
4
|
-
The official TypeScript / Node.js parser for **YINI** (by the YINI-lang project) —
|
|
4
|
+
The official TypeScript / Node.js parser for **YINI** (by the YINI-lang project) — a human-friendly configuration format with real structure, nested sections, comments, and predictable parsing.
|
|
5
|
+
|
|
6
|
+
YINI is designed for applications, tools, and services that need configuration that stays readable for humans without becoming vague, fragile, or hard to maintain.
|
|
5
7
|
|
|
6
8
|
[](https://www.npmjs.com/package/yini-parser) [](https://github.com/YINI-lang/yini-parser-typescript/actions/workflows/run-all-tests.yml) [](https://github.com/YINI-lang/yini-parser-typescript/actions/workflows/run-regression-tests.yml) [](https://github.com/YINI-lang/yini-parser-typescript/actions/workflows/run-grammar-drift-check.yml) [](https://www.npmjs.com/package/yini-parser)
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
## Quick Start
|
|
9
11
|
|
|
10
12
|
```sh
|
|
11
13
|
npm install yini-parser
|
|
12
14
|
```
|
|
13
15
|
|
|
14
|
-
```ts
|
|
15
|
-
import YINI from 'yini-parser'
|
|
16
|
-
const config = YINI.parseFile('./config.yini')
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
```sh
|
|
20
|
-
npm run test
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
➡️ See full [documentation or YINI format specification](https://github.com/YINI-lang/YINI-spec)
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Example of YINI code
|
|
28
|
-
> A basic YINI configuration example, showing a section, nested section, comments:
|
|
29
|
-

|
|
30
|
-
Source: [basic.yini](./samples/basic.yini)
|
|
31
|
-
|
|
32
|
-
## YINI Parser – (source code in TypeScript)
|
|
33
|
-
|
|
34
|
-
A runtime parser for the official [YINI configuration file format](https://github.com/YINI-lang/YINI-spec).
|
|
35
|
-
|
|
36
|
-
The parser follows the official YINI specification and is implemented in TypeScript.
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Quick Start
|
|
41
|
-
|
|
42
|
-
A small example using YINI in TypeScript/JavaScript:
|
|
43
16
|
```ts
|
|
44
17
|
import YINI from 'yini-parser'
|
|
45
18
|
|
|
46
19
|
const config = YINI.parse(`
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
// Indentation is only for readability.
|
|
20
|
+
^ App
|
|
21
|
+
name = 'My App'
|
|
22
|
+
darkMode = true
|
|
51
23
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
items = 25
|
|
55
|
-
darkMode = true // "ON" and "YES" works too
|
|
56
|
-
|
|
57
|
-
// Sub-section of the "App" section
|
|
58
|
-
^^ Special
|
|
59
|
-
primaryColor = #336699 // Hex number format
|
|
60
|
-
isCaching = false // "OFF" and "NO" works too
|
|
24
|
+
^^ Features
|
|
25
|
+
caching = on
|
|
61
26
|
`)
|
|
62
27
|
|
|
63
|
-
//
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
console.log(config.App.name) // My Title
|
|
67
|
-
console.log(config.App.Special.isCaching) // false
|
|
68
|
-
console.log()
|
|
69
|
-
console.log(config)
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
**Output:**
|
|
73
|
-
```js
|
|
74
|
-
My Title
|
|
75
|
-
false
|
|
76
|
-
|
|
77
|
-
{
|
|
78
|
-
App: {
|
|
79
|
-
name: 'My Title',
|
|
80
|
-
items: 25,
|
|
81
|
-
darkMode: true,
|
|
82
|
-
Special: {
|
|
83
|
-
primaryColor: 3368601,
|
|
84
|
-
isCaching: false
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
28
|
+
console.log(config.App.name) // My App
|
|
29
|
+
console.log(config.App.Features.caching) // true
|
|
88
30
|
```
|
|
89
31
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
- ▶️ Link to [Demo Apps](https://github.com/YINI-lang/yini-demo-apps/tree/main) with complete basic usage.
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
## Example 2
|
|
97
|
-
> A real-world YINI configuration example, showing sections, nesting, comments, and multiple data types:
|
|
98
|
-

|
|
99
|
-
Source: [config.yini](./samples/config.yini)
|
|
100
|
-
|
|
101
|
-
## 📂 More Examples
|
|
102
|
-
|
|
103
|
-
- ▶️ Explore more [YINI examples](https://yini-lang.org/learn-yini/examples/?utm_source=yini-parser-ts&utm_medium=github&utm_campaign=repo-link&utm_content=readme).
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
### Who is this for?
|
|
108
|
-
|
|
109
|
-
YINI is designed as an ideal option for application developers, platform teams, DevOps engineers, and anyone maintaining complex configuration at scale.
|
|
32
|
+
➡️ Learn more in the [YINI specification and documentation](https://yini-lang.org/refs/specification).
|
|
110
33
|
|
|
111
34
|
---
|
|
112
35
|
|
|
113
|
-
## 🙋♀️ Why YINI?
|
|
114
|
-
- **Indentation-independent structure:** The YINI config format is indentation-independent, meaning spaces and tabs never affect meaning.
|
|
115
|
-
- **Explicit nesting for easy refactoring & large configs:** It uses clear header markers (`^`, `^^`, `^^^`) to define hierarchy (like in Markdown), without long dotted keys.
|
|
116
|
-
- **Multiple data types:** Supports boolean literals (`true` / `false`, `Yes` / `No`, etc), numbers, arrays (lists), and JS-style objects natively, with explicit string syntax.
|
|
117
|
-
- **Comments support:** YINI supports multiple comment styles (`#`, `//`, `/* ... */`, and `;`). Allows you to document configuration directly in the file.
|
|
118
|
-
- **Predictable parsing rules:** Fewer production surprises, well-defined rules with optional strict and lenient modes, for different use cases.
|
|
36
|
+
## 🙋♀️ Why try YINI?
|
|
119
37
|
|
|
38
|
+
- **Readable by humans** — Less noisy than JSON, less fragile than indentation-driven formats.
|
|
39
|
+
- **Structured enough for real configuration** — Sections, nested sections, lists, objects, booleans, and null.
|
|
40
|
+
- **Predictable parsing** — Explicit syntax with clear rules.
|
|
41
|
+
- **Easy to use from TypeScript/Node.js** — Parse from strings or files in a few lines.
|
|
42
|
+
|
|
120
43
|
---
|
|
121
44
|
|
|
122
|
-
##
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
- Only the `YINI` class is exported; all internal details are private.
|
|
127
|
-
- Arrays/Lists (bracketed): `list = [10, 20, 30]`
|
|
128
|
-
- JavaScript-style objects (inline maps).
|
|
45
|
+
## What YINI looks like in practice
|
|
46
|
+
> A basic YINI configuration example, showing a section, nested section, comments:
|
|
47
|
+

|
|
48
|
+
Source: [basic.yini](./samples/basic.yini)
|
|
129
49
|
|
|
130
|
-
|
|
50
|
+
- ▶️ Link to [Demo Apps](https://github.com/YINI-lang/yini-demo-apps/tree/main) with complete basic usage.
|
|
131
51
|
|
|
132
52
|
---
|
|
133
53
|
|
|
134
|
-
##
|
|
135
|
-
|
|
136
|
-
|
|
54
|
+
## Why YINI works well for configuration
|
|
55
|
+
- **Indentation-independent structure:** Spaces and tabs never change meaning, so files can be reformatted without changing structure.
|
|
56
|
+
- **Explicit nesting:** Hierarchy is defined with section markers like `^`, `^^`, and `^^^`, making large configurations easier to scan and refactor.
|
|
57
|
+
- **Multiple data types:** Supports booleans (`true` / `false`, `yes` / `no`, etc.), numbers, lists, and inline objects, with explicit string syntax.
|
|
58
|
+
- **Comment support:** YINI supports multiple comment styles (`#`, `//`, `/* ... */`, and `;`), making it easier to document configuration directly in the file.
|
|
59
|
+
- **Predictable parsing:** Clear rules with optional strict and lenient modes for different use cases.
|
|
137
60
|
|
|
138
61
|
---
|
|
139
62
|
|
|
140
63
|
## Usage
|
|
141
64
|
|
|
142
|
-
###
|
|
65
|
+
### Install with your package manager
|
|
143
66
|
|
|
144
67
|
With **npm**:
|
|
145
68
|
```sh
|
|
@@ -160,8 +83,7 @@ pnpm add yini-parser
|
|
|
160
83
|
**Note:** Only a default export (YINI) is provided. Named imports are not supported.
|
|
161
84
|
```js
|
|
162
85
|
const YINI = require('yini-parser').default;
|
|
163
|
-
//
|
|
164
|
-
// (Some Node.js setups require the .default property, others don't, due to ESM/CommonJS interop quirks.)
|
|
86
|
+
// If your setup handles default interop differently, try:
|
|
165
87
|
// const YINI = require('yini-parser');
|
|
166
88
|
|
|
167
89
|
// Parse from string.
|
|
@@ -206,54 +128,50 @@ const configFromFile = YINI.parseFile('./config.yini');
|
|
|
206
128
|
|
|
207
129
|
---
|
|
208
130
|
|
|
209
|
-
##
|
|
210
|
-
|
|
211
|
-
1. **Improve existing functionality** — Ongoing improvements to core parsing, richer diagnostics, and expanded QA for areas not yet fully covered.
|
|
212
|
-
2. **Full spec compliance** — Complete support for all features in the YINI Specification v1.0.0 (and the latest RCs).
|
|
213
|
-
- Progress and current status are tracked in [FEATURE-CHECKLIST.md](https://github.com/YINI-lang/yini-parser-typescript/blob/main/FEATURE-CHECKLIST.md).
|
|
214
|
-
3. **Schema validation (future)** — Possible future expansion to support schema/contract validation for stricter type-safe configs.
|
|
215
|
-
4. **Ecosystem integration** - Broader and additional support for tooling, and other ecosystem projects.
|
|
131
|
+
## 📂 More Examples
|
|
216
132
|
|
|
217
|
-
|
|
218
|
-
Some advanced YINI features are still evolving and are tracked transparently.
|
|
133
|
+
- ▶️ Explore more [YINI examples](https://yini-lang.org/learn-yini/examples/?utm_source=yini-parser-ts&utm_medium=github&utm_campaign=repo-link&utm_content=readme).
|
|
219
134
|
|
|
220
|
-
|
|
135
|
+
### Example 2
|
|
136
|
+
> A real-world YINI configuration example, showing sections, nesting, comments, and multiple data types:
|
|
137
|
+

|
|
138
|
+
Source: [config.yini](./samples/config.yini)
|
|
221
139
|
|
|
222
140
|
---
|
|
223
141
|
|
|
224
|
-
##
|
|
225
|
-
We welcome feedback, bug reports, feature requests, and code contributions!
|
|
226
|
-
- [Open an Issue](https://github.com/YINI-lang/yini-parser-typescript/issues)
|
|
227
|
-
- [Start a Discussion](https://github.com/YINI-lang/yini-parser-typescript/discussions)
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
If this library is useful to you, a GitHub star helps guide future development.
|
|
231
|
-
|
|
232
|
-
---
|
|
142
|
+
## 🧪 Testing and Stability
|
|
233
143
|
|
|
234
|
-
|
|
235
|
-
- [Project Setup](https://github.com/YINI-lang/yini-parser-typescript/blob/main/docs/Project-Setup.md) — How to run, test, and build the project, etc.
|
|
236
|
-
- [Conventions](https://github.com/YINI-lang/yini-parser-typescript/blob/main/docs/Conventions.md) — Project conventions, naming patterns, etc.
|
|
144
|
+
This parser is continuously validated through comprehensive regression and smoke tests, ensuring deterministic parsing behavior across default, strict, and metadata-enabled modes.
|
|
237
145
|
|
|
238
146
|
---
|
|
239
147
|
|
|
240
148
|
## Links
|
|
241
|
-
- ➡️ [
|
|
242
|
-
*
|
|
149
|
+
- ➡️ [YINI Homepage](https://yini-lang.org)
|
|
150
|
+
*Tutorials, guides, and examples.*
|
|
243
151
|
|
|
244
152
|
- ➡️ [YINI CLI on GitHub](https://github.com/YINI-lang/yini-cli)
|
|
245
|
-
*
|
|
153
|
+
*CLI tooling for working with YINI files.*
|
|
246
154
|
|
|
247
155
|
- ➡️ [YINI Project](https://github.com/YINI-lang)
|
|
248
|
-
*
|
|
156
|
+
*Repositories and related ecosystem projects.*
|
|
249
157
|
|
|
250
|
-
|
|
251
|
-
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## 🤝 Contributing
|
|
161
|
+
We welcome feedback, bug reports, feature requests, and code contributions!
|
|
162
|
+
- [Open an Issue](https://github.com/YINI-lang/yini-parser-typescript/issues)
|
|
163
|
+
- [Start a Discussion](https://github.com/YINI-lang/yini-parser-typescript/discussions)
|
|
164
|
+
|
|
165
|
+
If this library is useful to you, a GitHub star helps more people discover the project and supports future development.
|
|
166
|
+
|
|
167
|
+
### Documentation
|
|
168
|
+
- [Project Setup](https://github.com/YINI-lang/yini-parser-typescript/blob/main/docs/Project-Setup.md) — How to run, test, and build the project, etc.
|
|
169
|
+
- [Conventions](https://github.com/YINI-lang/yini-parser-typescript/blob/main/docs/Conventions.md) — Project conventions, naming patterns, etc.
|
|
252
170
|
|
|
253
171
|
---
|
|
254
172
|
|
|
255
173
|
## License
|
|
256
|
-
This project is licensed under the Apache-2.0 license
|
|
174
|
+
This project is licensed under the Apache-2.0 license — see the [LICENSE](./LICENSE) file for details.
|
|
257
175
|
|
|
258
176
|
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`.
|
|
259
177
|
|
|
@@ -264,4 +182,4 @@ In this project on GitHub, the `libs` directory contains third party software an
|
|
|
264
182
|
>
|
|
265
183
|
> Predictable configuration with clear rules.
|
|
266
184
|
|
|
267
|
-
[yini-lang.org](https://yini-lang.org/?utm_source=github&utm_medium=referral&utm_campaign=yini_parser_ts&utm_content=readme_footer) · [YINI on GitHub](https://github.com/YINI-lang)
|
|
185
|
+
[yini-lang.org](https://yini-lang.org/?utm_source=github&utm_medium=referral&utm_campaign=yini_parser_ts&utm_content=readme_footer) · [YINI-lang on GitHub](https://github.com/YINI-lang)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yini-parser",
|
|
3
|
-
"version": "1.4.3
|
|
4
|
-
"description": "TypeScript/JavaScript parser for YINI
|
|
3
|
+
"version": "1.4.3",
|
|
4
|
+
"description": "TypeScript/JavaScript parser for YINI — a human-friendly config format that combines INI-style simplicity with real structure, nested sections, comments, and predictable parsing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yini",
|
|
7
7
|
"yini-parser",
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
"parser",
|
|
18
18
|
"parse",
|
|
19
19
|
"read",
|
|
20
|
-
"
|
|
21
|
-
"javascript"
|
|
20
|
+
"files"
|
|
22
21
|
],
|
|
23
22
|
"homepage": "https://yini-lang.org/",
|
|
24
23
|
"license": "Apache-2.0",
|