New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@wooksjs/event-http

Package Overview
Dependencies
Maintainers
0
Versions
97
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wooksjs/event-http

@wooksjs/event-http

  • 0.5.25
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@wooksjs/event-http

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


As a part of wooks event processing framework, @wooksjs/event-http implements http events and provides composables that let you:

  • parse urls search params
  • parse cookies
  • parse request body (json, url-encoded, form, ...)
  • serve files

The main ideas behind composable functions are:

  1. Never mutate request object (req). Accumulate a request context in a separate object(s) instead (wooks store);
  2. Never parse anything (cookies, body) before it is really requested by the request handler;
  3. Get rid of complex predefined data objects containing everything (cookies, headers, body, parsed body etc.) and use composable functions (hooks) instead;
  4. Get rid of tons of dependencies (middlewares) and implement everything that is needed for web app in a simple way.

Official Wooks HTTP composables:

Installation

npm install wooks @wooksjs/event-http

Quick Start

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')
})

Documentation

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

Keywords

FAQs

Package last updated on 17 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc