[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/script-host](https://jsprismarine.dev/api/@jsprismarine/script-host/index.md) / host/addonConfig

# host/addonConfig

## Interfaces

### AddonConfigStore

Defined in: [script-host/src/host/addonConfig.ts:10](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/host/addonConfig.ts#L10)

A pack's config file, as the server keeps it.

#### Methods

##### read()

> **read**(`pack`): `unknown`

Defined in: [script-host/src/host/addonConfig.ts:15](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/host/addonConfig.ts#L15)

The parsed JSON of the pack's config file, or undefined when there is no file. A file that
fails to parse gives the value the last good read gave, and the server logs the failure once.

###### Parameters

###### pack

[`ScriptPack`](https://jsprismarine.dev/api/@jsprismarine/script-host/host/pack/index.md#scriptpack)

###### Returns

`unknown`

##### watch()

> **watch**(`pack`, `changed`): () => `void`

Defined in: [script-host/src/host/addonConfig.ts:23](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/host/addonConfig.ts#L23)

Watches the pack's config file. `changed` may run on any turn of the event loop, and the
runtime reads the file and raises the pack's event on its next flush.

###### Parameters

###### pack

[`ScriptPack`](https://jsprismarine.dev/api/@jsprismarine/script-host/host/pack/index.md#scriptpack)

###### changed

() => `void`

###### Returns

Stops the watch.

() => `void`

##### write()

> **write**(`pack`, `value`): `void`

Defined in: [script-host/src/host/addonConfig.ts:17](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/script-host/src/host/addonConfig.ts#L17)

Rewrites the pack's config file with a value, as JSON.

###### Parameters

###### pack

[`ScriptPack`](https://jsprismarine.dev/api/@jsprismarine/script-host/host/pack/index.md#scriptpack)

###### value

`unknown`

###### Returns

`void`
