Classes
Class implementation for fine control of INI data structures.
- clear(sectionName?: string): void
Clear a single section or the entire INI.
- comments(): Comments
Manage comments in the INI.
- delete(key: string): boolean
Delete a global key in the INI.
- entries(): Generator<[string, unknown, string | undefined]>
Iterate over each entry in the INI to retrieve key, value, and section.
- formatting(): FormattingNo documentation available
- from(): IniMapinput: string,options?: ParseOptions & FormattingOptions
Create an
IniMapfrom an INI string. - get(key: string): unknown
Get a value from a global key in the INI.
- has(key: string): boolean
Check if a global key exists in the INI.
- parse(): thistext: string,reviver?: ReviverFunction
Parse an INI string in this
IniMap. - set(): thiskey: string,value: any
Set the value of a global key in the INI.
- size(): number
Get the count of key/value pairs.
- toJSON(): Record<string, unknown | Record<string, unknown>>
Convenience method for
JSON.stringify. - toObject(): Record<string, unknown | Record<string, unknown>>
Convert this
IniMapto a plain object. - toString(replacer?: ReplacerFunction): string
Convert this
IniMapto an INI string.
Interfaces
- clear(): void
Clear all comments in the INI.
- deleteAtKey(key: string): boolean
Delete a comment before a global key in the INI.
- deleteAtLine(line: number): boolean
Delete a comment at a specific line in the INI.
- deleteAtSection(section: string): boolean
Delete a comment before a section line in the INI.
- getAtKey(key: string): string | undefined
Get a comment before a global key in the INI.
- getAtLine(line: number): string | undefined
Get a comment at a specific line in the INI.
- getAtSection(section: string): string | undefined
Get a comment before a section line in the INI.
- setAtKey(): Commentskey: string,text: string
Set a comment before a global key in the INI.
- setAtLine(): Commentsline: number,text: string
Set a comment at a specific line in the INI.
- setAtSection(): Commentssection: string,text: string
Set a comment before a section line in the INI.
Options for providing formatting marks.
- assignment: string
The character used to assign a value to a key; defaults to '='.
- commentChar: "#" | ";" | "//"
Mark to use for setting comments; expects '#', ';', '//', defaults to '#' unless another mark is found.
- deduplicate: boolean
Filter duplicate keys from INI string output; defaults to false to preserve data parity.
- lineBreak: "\n" | "\r\n"
Character(s) used to break lines in the config file; defaults to '\n'. Ignored on parse.
- pretty: boolean
Use a plain assignment char or pad with spaces; defaults to false. Ignored on parse.
Options for parsing INI strings.
- assignment: FormattingOptions["assignment"]
The character used to assign a value to a key; defaults to '='.
- reviver: ReviverFunction
Provide custom parsing of the value in a key/value pair.
Options for constructing INI strings.
- replacer: ReplacerFunction
Provide custom string conversion for the value in a key/value pair.
Type Aliases
Function for replacing JavaScript values with INI string values.
Function for replacing INI values with JavaScript values.