API Reference

ini

An INI parser and serializer for Node.js that also supports sections, escaping, and merge.

Official Documentation ↗
CompatibilityThis documentation covers version v7.0.0. Check the official docs for the latest API surface.

Installation

npmnpm install ini

Methods

The ini package reads and writes INI files, converting sections into nested objects.

Key Features

  • Section-aware encode and decode
  • String coercion of null, true, and false
  • Whitespace handling for dotted keys

Usage Notes

Pin a version and check the official docs for the API surface you depend on before upgrading.

API reference evidence

Fetched from official sources on 2026-11-08T20:08:00+08:00 via WebFetch https://raw.githubusercontent.com/npm/ini/main/README.md;WebFetch https://cdn.jsdelivr.net/npm/[email protected]/lib/ini.js.

FAQ

How are dotted keys handled?
Set whitespace: true (the default) to keep parent.child flattened; dotted section names are treated as literal keys unless encode changes that.
Does ini support arrays?
Not natively. ini is designed for simple INI files; use JSON or YAML when you need arrays or deep nesting.
Why did my numbers become strings?
ini.parse keeps values as strings and only coerces null, true, and false. Convert numbers explicitly with Number().