parse and stringify for handling INI encoded data, such as the Desktop Entry specification.
parse
stringify
import { parse, stringify } from "@std/ini";import { assertEquals } from "@std/assert";const text = `Global Key=Some data here[Section #1]Section Value=42Section 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); Copy
import { parse, stringify } from "@std/ini";import { assertEquals } from "@std/assert";const text = `Global Key=Some data here[Section #1]Section Value=42Section 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);
parseandstringifyfor handling INI encoded data, such as the Desktop Entry specification.