Skip to main content
The browser’s localStorage, persistent across script reloads and game restarts. Global, no import.
Storage is per script folder, not manifest.name. Scripts never see each other’s keys.
Unlike the browser, values aren’t stringified: you get back the type you stored (numbers, booleans, objects, arrays, Map, Set, Date, typed arrays, BigInt). Class instances come back as plain objects. Functions and native objects (Vector, Pointer, …) throw a DataCloneError.

Methods

getItem


A copy of the stored value, or null when the key doesn’t exist.

setItem


Stores value under key. undefined removes the key, null is stored as a value.

Others

Keys must be strings; anything else throws TypeError.

Property access

Keys work as properties too.
Keys named like a method, length or toString need getItem / setItem.

Example

Remember the last few maps played.