tgy
July 30, 2024 at 14:04
8 Feb 2024 Kizma

Couple of days ago I released npmjs.com/kizma. It is a package, that wraps around regular typescript functions to create rest api backend and generated frontend. Right now it only supports strings and numbers as function parameters.

So this works:
function okay(id: number, text: string) {
  //…
}

And this wouldn’t:
function unsupported(credentials: Object, user: TUserData) {
  //…
}

However, assigning string/number to type would work:
type TUserData = string
function stillOkay(user: TUserData) {
  //…
}

You pull all your files into api/ folder
  1. Initialize with npm init, if you haven’t already
  2. install kizma npm i -D kizma
  3. run npm exec kizma
  4. run node server.cjs
  5. Go to localhost:8080/{filename}.html


To do what?
“I honestly don’t know” - Ryan Gosling

Well, this would save you little time, your project will be more understandable, organized by file-based routing. You would not have to worry about serialization, performance, security. Kizma takes some load off.

It is great for prototyping. No special setup needed to go from test.ts to fully functional application.
It can be used for internal apps.