magus v0.4.3 is out. See what's new
¶ View generated markdown
1 min read

ini

INI/properties config parsing and rendering (.npmrc, .gitconfig, .editorconfig).

Naming convention: import the module under its bare name (import "ini"), reach members with a backslash, and call methods in camelCase: ini\someMethod.

Methods

parse

Parse INI text into {section: {key: value}}. Entries before the first [section] header are under the "" key, which is where a flat file like .npmrc puts everything. Values are always strings; a repeated key takes the last value.

Signature: ini\parse(source) -> map[string]map[string]string - source

Parameter Type Optional Description
source string

Returns: map[string]map[string]string

stringify

Render {section: {key: value}} back to INI text. The "" section is written first with no header, then the rest sorted by name with their keys sorted, so the output is byte-stable and diffs cleanly.

Signature: ini\stringify(sections) -> string - source

Parameter Type Optional Description
sections map[string]map[string]string

Returns: string

generatedreference/buzz/inimodulestdlibmagusfile
Last updated (29d8b3de)
Earlier changes on this page (4)

Full history ↗ · Blame source ↗

Glossary

Magusfile

The magusfile.buzz that declares a project's targets (as export funs) and binds its spells. Magusfile in full.

Op

A single tool-native command a target composes (long form: operation); the middle of the work hierarchy (Spell to Op to Target). Op in full.

Module

A magus stdlib namespace a magusfile imports for host capabilities: filesystem, exec, vcs, and more. Module in full.

Buzz

The language magusfiles are written in (the .buzz engine). Buzz in full.

Conventions

This page uses none of the site's convention markers. The full set is on the conventions page.