magus v0.4.2 is out. See what's new
¶ View generated markdown

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 (4f8cc295)
Earlier changes on this page (2)

Full history ↗ · Blame source ↗

Glossary

Magusfile

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

Op

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

Module

A magus stdlib namespace a magusfile imports for host capabilities: filesystem, exec, vcs, and more. See the module reference.

Buzz

The language magusfiles are written in (the .buzz engine). See engines.

Conventions

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