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

0.4.35 • Public • Published

Wooks

!!! This is work-in-progress library, breaking changes are expected !!!


Wooks is a Event Processing Framework based on composable (hooks) functions.

wooks + @wooksjs/event-http = Web Application Framework with hooks.

As an alternative for express and fastify, wooks brings the whole different approach for processing http requests. It utilizes such a technique as you can see in React Hooks or Vue Composables. It has only a dependency on @prostojs/router (an alternative to find-my-way used by fastify) which is a very fast (see benchmarks here) and robust URI router.

HTTP Composables packs:

Installation

npm install wooks

Quick Start with a Web App

npm install wooks @wooksjs/event-http

import { useRouteParams } from 'wooks'
import { createHttpApp } from '@wooksjs/event-http'

const app = createHttpApp()

app.on('GET', 'hello/:name', () => `Hello ${useRouteParams().get('name')}!`)

// shortcuts for some methods are supported:
// app.get('hello/:name', () => `Hello ${ useRouteParams().get('name') }!`)

app.listen(3000, () => {
  console.log('Wooks Server is up on port 3000')
})

See full documentation for http event here

Documentation

To check out docs, visit wooks.moost.org.

Package Sidebar

Install

npm i wooks

Weekly Downloads

63

Version

0.4.35

License

MIT

Unpacked Size

10.9 kB

Total Files

5

Last publish

Collaborators

  • mav-rik