@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 Parameter | Default type | Description |
|---|---|---|
Res extends CommonObj | CommonObj | The expected return type of the deserialized object |
Parameters β
| Parameter | Type | Description |
|---|---|---|
input | string | The INI content string |
options? | DecodeOptions | Options |
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 Parameter | Description |
|---|---|
I extends CommonObj | The type of the object to be converted. |
Parameters β
| Parameter | Type | Description |
|---|---|---|
input | I | The object to be converted. |
options? | EncodeOptions | Options 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;