Skip to content

Platform Support ​

The library treats the native uni.setStorage API family as its only underlying dependency (unified across platforms) and is a pure orchestration layer with no per-platform directories. UTS source is distributed and compiled on the fly by the uni-app x toolchain:

PlatformStatus
Web✅ Build verified, all 22 verification logs passed (six groups: basic I/O / TTL / namespace / instances / clearExpired / error paths)
WeChat Mini ProgramSame codebase for all platforms, pending testing
AndroidSame codebase for all platforms, pending device testing
iOS / HarmonyOSAdapted, untested due to environment limits (iOS needs macOS, HarmonyOS needs DevEco Studio)

Platform differences ​

DifferenceNotes
Capacity limitsH5 ~5MB / Mini Programs ~10MB; on Web info().limitSize returns Number.MAX_VALUE (no limit concept). The library exposes info() for self-management and does no LRU eviction (a v1 design decision)
Miss shapeNative getStorage fails on missing keys ("data not found"); the adapter translates it into "resolve(null)" so the contract matches on every platform
Serialization round tripTyped objects read back as UTSJSONObject (official "type data storage" docs); restore types via the official JSON.parse<T>(JSON.stringify(raw)) path

Verify it yourself ​

The repo ships a verification project at packages/playground. The home page navigates into six verification pages grouped by feature (basic I/O / TTL / namespaces & instances / global config / clearExpired / error paths); each page auto-runs its checks on open and prints [verify] logs. Runs directly on Web:

bash
pnpm install
cd packages/playground
pnpm build:web
npx serve --single dist/build/h5

Released under the MIT License.