Skip to content
프로젝트

소개

kotlinx.coroutines, kotlinx.serialisation 및 kotlinx.io를 사용해 객체를 디스크에 저장하고 디스크에서 복원할 수 있도록 지원하는 작은 Kotlin Multiplatform 라이브러리입니다.

개발 도구

이 수치를 측정하는 방법

What you can do

  • 🔒 Read-write locks; with a mutex FIFO lock
  • 💾 In-memory caching; read once from disk and reuse
  • 📬 Default values; no file? no problem!
  • 🚚 Migration support; moving shop? take your data with you

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

KStore

Build codecov

Kotlin Beta Kotlin Maven Central

badge-android badge-ios badge-mac badge-jvm badge-linux badge-windows badge-nodejs badge-jsBrowser badge-wasmJsBrowser

A tiny Kotlin multiplatform library that assists in saving and restoring objects to and from disk using kotlinx.coroutines, kotlinx.serialization and kotlinx.io. Inspired by RxStore

Features

  • 🔒 Read-write locks; with a mutex FIFO lock
  • 💾 In-memory caching; read once from disk and reuse
  • 📬 Default values; no file? no problem!
  • 🚚 Migration support; moving shop? take your data with you
  • 🚉 Multiplatform!

Installation

KStore is published on Maven Central. Latest version Maven Central

repositories { 
  mavenCentral()
  // or for snapshot builds
  maven("https://central.sonatype.com/repository/maven-snapshots/")
}
# for common
kstore = { module = "io.github.xxfast:kstore", version.ref = "kstore" }

# for android, iOS, desktop and nodeJs
kstore-file = { module = "io.github.xxfast:kstore-file", version.ref = "kstore" }

# for jsBrowser and wasmJsBrowser
kstore-storage = { module = "io.github.xxfast:kstore-storage", version.ref = "kstore" }

Depending on your target platforms, you will need to add platform configurations here

At a glance

import kotlin.io.path.Path
import kotlinx.serialization.Serializable

// Take any serializable model 
@Serializable data class Pet(val name: String, val age: Int) 

// Create a store
val store: KStore<Pet> = storeOf(file = Path("path/to/my_cats.json"))

// Get, set, update or delete values 
val mylo: Pet? = store.get()
store.set(mylo)
store.update { pet: Pet? ->
  pet?.copy(age = pet.age + 1)
}
store.delete()

// Observe for updates
val pets: Flow<Pet?> = store.updates

Installation and Usage

Documentation here

API Reference here

Licence

Copyright 2023-2026 Isuru Rajapakse

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

관련 프로젝트 살펴보기

불러오는 중…