Thanks to visit codestin.com
Credit goes to github.com

Skip to content

propolies/kavi

Repository files navigation

kavi

npm version

The easiest way to achieve typesafe APIs in SvelteKit. This is meant to be an easy, simple and lightweight alternative to tRPC-SvelteKit. Kavi handles both +page.server.ts, +page.ts and +page.svelte files seamlessly.

Install

npm i kavi zod

Usage

// server
export const router = {
  add: middleware.args(z.tuple([z.number(), z.number()])).call(([a, b]) => {
    return a + b
  }),
}
// client
await api.add([1, 2]).ok() // 3

Read more in the docs

About

End2End type-safety in SvelteKit

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published