Skip to content
/ wezi Public

Wezi is a small, minimalist, incredibly fast and adaptive library to create web applications.

License

Notifications You must be signed in to change notification settings

11ume/wezi

Repository files navigation





Wezi is small, minimalist, fast, adaptive, library
to create web applications.


ci status js-standard-style codecov

Features


  • Small Easy to learn and adapt.
  • Simplicity Based on laws of simplicity.
  • Fast Performance really near to native 🔥.
  • High control Extremely versatile, low level abstraction, you have the control.
  • Focus opt-in: All features are opt-in.
  • Async Implements an enhanced async control of handlers execution.

Install

npm install wezi

Usage


Functionalities preview

import wezi, { listen } from 'wezi'
import { text } from 'wezi-send'

const w = wezi(c => text(c, 'Hi!'))
listen(w())

Simple rounting

import wezi, { Context, listen } from 'wezi'
import router, { get } from 'wezi-router'
import { json } from 'wezi-send'
import createError from 'wezi-error'

type GetOneParam = {
    id?: string
}

const validateGetOneParams = (c: Context, params: GetOneParam) => params.id
    ? c.next(params.id)
    : c.panic(createError(400, 'the param "id", is required'))

const getOne = (c: Context, id: string) => json(c, {
    id
    , name: 'foo'
    , surname: 'bar'
})

const r = router(get('/users/:id', validateGetoneParams, getOne))
const w = wezi()
listen(w(r))
curl http://localhost:3000/users/123

Note: If u are using Javascript remember enable ESM support in you package.json. esm_enabling

About

Wezi is a small, minimalist, incredibly fast and adaptive library to create web applications.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •