Skip to content

LLM Resources

@structium/ini - API documentation ​

Functions ​

deserialize() ​

ts
function deserialize<Res>(input: string, options?: DecodeOptions): Promise<Res>

Deserialize an INI string into a JavaScript object.

Type Parameters ​

Type ParameterDefault typeDescription
Res extends CommonObjCommonObjThe expected return type of the deserialized object

Parameters ​

ParameterTypeDescription
inputstringThe INI content string
options?DecodeOptionsOptions

Returns ​

Promise<Res>

  • The deserialized JavaScript object

Throws ​

  • If the content is detected as HTML

serialize() ​

ts
function serialize<I>(input: I, options?: EncodeOptions): Promise<string>

Serialize a JavaScript object into an INI string.

Type Parameters ​

Type ParameterDescription
I extends CommonObjThe type of the object to be converted.

Parameters ​

ParameterTypeDescription
inputIThe object to be converted.
options?EncodeOptionsOptions to pass to ini.stringify

Returns ​

Promise<string>

  • A promise that resolves to the INI string.

Type Aliases ​

DeserializeOptions ​

ts
type DeserializeOptions: IniLib.DecodeOptions;

SerializeOptions ​

ts
type SerializeOptions: IniLib.EncodeOptions;