yini-parser
v1.4.3
Published
TypeScript/JavaScript parser for YINI — a human-friendly config format that combines INI-style simplicity with real structure, nested sections, comments, and predictable parsing.
Maintainers
Readme
yini-parser
Readable configuration for Node.js and TypeScript — without YAML foot-guns or JSON noise.
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.
YINI is designed for applications, tools, and services that need configuration that stays readable for humans without becoming vague, fragile, or hard to maintain.
Quick Start
npm install yini-parserimport YINI from 'yini-parser'
const config = YINI.parse(`
^ App
name = 'My App'
darkMode = true
^^ Features
caching = on
`)
console.log(config.App.name) // My App
console.log(config.App.Features.caching) // true➡️ Learn more in the YINI specification and documentation.
🙋♀️ Why try YINI?
- Readable by humans — Less noisy than JSON, less fragile than indentation-driven formats.
- Structured enough for real configuration — Sections, nested sections, lists, objects, booleans, and null.
- Predictable parsing — Explicit syntax with clear rules.
- Easy to use from TypeScript/Node.js — Parse from strings or files in a few lines.
What YINI looks like in practice
A basic YINI configuration example, showing a section, nested section, comments:
Source: basic.yini
- ▶️ Link to Demo Apps with complete basic usage.
Why YINI works well for configuration
- Indentation-independent structure: Spaces and tabs never change meaning, so files can be reformatted without changing structure.
- Explicit nesting: Hierarchy is defined with section markers like
^,^^, and^^^, making large configurations easier to scan and refactor. - Multiple data types: Supports booleans (
true/false,yes/no, etc.), numbers, lists, and inline objects, with explicit string syntax. - Comment support: YINI supports multiple comment styles (
#,//,/* ... */, and;), making it easier to document configuration directly in the file. - Predictable parsing: Clear rules with optional strict and lenient modes for different use cases.
Usage
Install with your package manager
With npm:
npm install yini-parserWith yarn:
yarn add yini-parserWith pnpm:
pnpm add yini-parserNode.js (CommonJS)
Note: Only a default export (YINI) is provided. Named imports are not supported.
const YINI = require('yini-parser').default;
// If your setup handles default interop differently, try:
// const YINI = require('yini-parser');
// Parse from string.
const config = YINI.parse(`
^ App
title = 'My App Title'
items = 25
isDarkTheme = true
`);
// Parse from file.
const configFromFile = YINI.parseFile('./config.yini');TypeScript (with "esModuleInterop": true)
import YINI from 'yini-parser';
// Parse from string.
const config = YINI.parse(`
^ App
title = "My App Title"
items = 25
isDarkTheme = OFF
`);
// Parse from file.
const configFromFile = YINI.parseFile('./config.yini');Example Output
// JS object
{
App: {
title: "My App Title",
items: 25,
isDarkTheme: false
}
}📂 More Examples
- ▶️ Explore more YINI examples.
Example 2
A real-world YINI configuration example, showing sections, nesting, comments, and multiple data types:
Source: config.yini
🧪 Testing and Stability
This parser is continuously validated through comprehensive regression and smoke tests, ensuring deterministic parsing behavior across default, strict, and metadata-enabled modes.
Links
➡️ YINI Homepage
Tutorials, guides, and examples.➡️ YINI CLI on GitHub
CLI tooling for working with YINI files.➡️ YINI Project
Repositories and related ecosystem projects.
🤝 Contributing
We welcome feedback, bug reports, feature requests, and code contributions!
If this library is useful to you, a GitHub star helps more people discover the project and supports future development.
Documentation
- Project Setup — How to run, test, and build the project, etc.
- Conventions — Project conventions, naming patterns, etc.
License
This project is licensed under the Apache-2.0 license — see the LICENSE file for details.
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.
^YINI ≡
Readable like INI. Structured like JSON. No indentation surprises.
Predictable configuration with clear rules.

Source:
Source: