@typed-storage/core
v0.1.0
Published
   to build better apps.
Usage
Two steps: define your schema and use it like normal localStorage.
- Define your schema
// schema.ts
import { defineStorage } from "@typed-storage/core"
// Feel free to use any other StandardSchema compatible library
import { z } from "zod"
const { storage } = defineStorage({
theme: z.enum(["light", "dark"]),
})
export { storage }- Use the storage
// my-file.ts
import { storage } from "./schema"
storage.set("theme", "light")
const theme = storage.get("theme")Installation
You can install this package with any package manager you like.
pnpm add @typed-storage/coreFeedback and Contributing
I highly appreceate your feedback! Please create an issue, if you've found any bugs or want to request a feature.
