Skip to main content

@std/ini@0.215.0

latest
Works with
It is unknown whether this package works with Browsers, Deno, Node.js, Cloudflare Workers, Bun
It is unknown whether this package works with Browsers
It is unknown whether this package works with Deno
It is unknown whether this package works with Node.js
It is unknown whether this package works with Cloudflare Workers
It is unknown whether this package works with Bun
JSR Score76%
Published2 years ago (0.215.0)
class IniMap

Class implementation for fine control of INI data structures.

Constructors

new IniMap(formatting?: FormattingOptions)

Static Methods

Create an IniMap from an INI string.

from(
input: Record<string, any>,
formatting?: FormattingOptions
): IniMap

Create an IniMap from a plain object.

Properties

Manage comments in the INI.

readonly
formatting: Formatting

Get the count of key/value pairs.

Methods

clear(sectionName?: string): void

Clear a single section or the entire INI.

Delete a global key in the INI.

Delete a section key in the INI.

entries(): Generator<[string, unknown, string | undefined]>

Iterate over each entry in the INI to retrieve key, value, and section.

get(key: string): unknown

Get a value from a global key in the INI.

get(
section: string,
key: string
): unknown

Get a value from a section key in the INI.

Check if a global key exists in the INI.

Check if a section key exists in the INI.

parse(
text: string,
reviver?: ReviverFunction
): this

Parse an INI string in this IniMap.

set(
key: string,
value: any
): this

Set the value of a global key in the INI.

set(
section: string,
key: string,
value: any
): this

Set the value of a section key in the INI.

toJSON(): Record<string, unknown | Record<string, unknown>>

Convenience method for JSON.stringify.

toObject(): Record<string, unknown | Record<string, unknown>>

Convert this IniMap to a plain object.

Convert this IniMap to an INI string.

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/ini

Import symbol

import { IniMap } from "@std/ini";
or

Import directly with a jsr specifier

import { IniMap } from "jsr:@std/ini";