@knownasrazi/ini
v1.0.0
Published
Parse and serialize INI files with sections, comments, multiline values and typed booleans.
Maintainers
Readme
ini
Parse and serialize INI files.
Zero dependencies - ~2 KB gzipped - TypeScript - Node + Bun + browser
Install
bun add @knownasrazi/ini
npm install @knownasrazi/iniUsage
import { parse, stringify } from "@knownasrazi/ini";
const data = parse(`
[app]
port = 3000
debug = true
[db]
host = localhost
`);
data.app.port; // 3000
data.db.host; // "localhost"
stringify({ app: { port: 3000, debug: true } }); // "[app]\nport = 3000\n..."API
| Export | Description |
| --- | --- |
| parse(input, opts?) | string -> Record<string, Record<string, IniValue>> |
| stringify(data) | IniData -> string (quoted when needed) |
ParseOptions: { allowIntact?: boolean } (coerces true/false/number).
Development
git clone https://github.com/knownasrazi/ini.git
cd ini
bun install
bun test
bun run build
bun run lintLicense
ini - configs without the toml.
