kavi
TypeScript icon, indicating that this package has built-in type declarations

0.0.0-pre.16 • Public • Published

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

/kavi/

    Package Sidebar

    Install

    npm i kavi

    Weekly Downloads

    4

    Version

    0.0.0-pre.16

    License

    MIT

    Unpacked Size

    20.8 kB

    Total Files

    36

    Last publish

    Collaborators

    • propoli