std/ini/mod.ts
Lucas Wasilewski bc20dbe21b
BREAKING(ini): parse understands booleans, undefined, null and numbers (#6121)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-11-06 13:45:40 +09:00

36 lines
935 B
TypeScript

// Copyright 2018-2024 the Deno authors. All rights reserved. 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";