All files / ini / mod.ts

100.00% Branches 0/0
100.00% Lines 2/2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
x3
x3

































// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.

/**
 * {@linkcode parse} and {@linkcode stringify} for handling
 * {@link https://en.wikipedia.org/wiki/INI_file | INI} encoded data, such as the
 * {@link https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s03.html | Desktop Entry specification}.
 *
 * ```ts
 * import { parse, stringify } from "@std/ini";
 * import { assertEquals } from "@std/assert";
 *
 * const text = `Global Key=Some data here
 * [Section #1]
 * Section Value=42
 * Section Date=1977-05-25`;
 *
 * const parsed = parse(text);
 *
 * assertEquals(parse(text), {
 *   "Global Key": "Some data here",
 *   "Section #1": {
 *     "Section Value": 42,
 *     "Section Date": "1977-05-25",
 *   },
 * });
 *
 * assertEquals(stringify(parsed), text);
 * ```
 *
 * @module
 */

export * from "./parse.ts";
export * from "./stringify.ts";