Skip to content

Type Alias: InitOptions ​

InitOptions = object

Defined in: src/index.ts:294

Options for init.

This example requires Node.js.

ts
import init from 'osu-files'
import type { InitOptions } from 'osu-files'

const options = {
  readOnly: true,
  filesFolderPath: './files',
} satisfies InitOptions

return init('client.realm', options)

Properties ​

archiveLimits? ​

optional archiveLimits?: ArchiveLimits

Defined in: src/index.ts:308

Limits for untrusted archive input.


checkHash? ​

optional checkHash?: boolean

Defined in: src/index.ts:304

Every write checks if hash is present in the files folder.


filesFolderPath? ​

optional filesFolderPath?: string

Defined in: src/index.ts:302

migration? ​

optional migration?: object

Defined in: src/index.ts:310

Realm migration options.

backup? ​

optional backup?: boolean

Keep a pre-migration copy under the system temporary directory.

Default ​
ts
true

legacyCollectionPath? ​

optional legacyCollectionPath?: string

Legacy collection database path. Defaults to a sibling collection.db.

onEvent? ​

optional onEvent?: (event) => void

Receives migration progress and warning events.

Parameters ​
ParameterType
eventMigrationEvent
Returns ​

void


readOnly? ​

optional readOnly?: boolean

Defined in: src/index.ts:298

Default ​

ts
false

rollback? ​

optional rollback?: RollbackOptions | false

Defined in: src/index.ts:300

Default ​

ts
{ enabled: true }

schemaVersion? ​

optional schemaVersion?: number

Defined in: src/index.ts:296

Default ​

ts
CURRENT_SCHEMA_VERSION

Released under the MIT License.