New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

waiter-framework

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

waiter-framework

High-performance web framework with IoC and decorators

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

Waiter Framework

A lightweight, TypeScript-first web framework with built-in dependency injection and decorator-based routing.

Installation

npm install waiter-framework

Quick Start

import { bootstrapWaiter, Web, Get, WaiterRequest } from 'waiter-framework';

@Web('/api')
class UserController {
  @Get('/users')
  async getUsers(req: WaiterRequest) {
    return {
      statusCode: 200,
      body: { users: [] },
    };
  }
}

bootstrapWaiter(3000);

Features

  • Decorator-based routing
  • Built-in IoC container
  • TypeScript support
  • Interceptor/middleware system
  • Zero configuration required

Dependency Injection

import { Web, Get, Inject, Wire } from 'waiter-framework';

@Wire('database')
class Database {
  query(sql: string) {
    // implementation
  }
}

@Web('/api')
class UserController {
  constructor(@Inject('database') private db: Database) {}

  @Get('/users')
  async getUsers() {
    const users = this.db.query('SELECT * FROM users');
    return { statusCode: 200, body: users };
  }
}

Interceptors

import {
  bootstrapWaiter,
  WaiterRequest,
  WaiterResponse,
} from 'waiter-framework';

const authInterceptor = async (
  req: WaiterRequest
): Promise<WaiterResponse | void> => {
  const token = req.serverRequest.headers['authorization'];

  if (!token) {
    return { statusCode: 401, body: { error: 'Unauthorized' } };
  }
};

bootstrapWaiter(3000, authInterceptor);

HTTP Methods

@Web('/api')
class ProductController {
  @Get('/products')
  async list() {
    /* ... */
  }

  @Post('/products')
  async create(req: WaiterRequest) {
    /* ... */
  }

  @Put('/products/:id')
  async update(req: WaiterRequest) {
    /* ... */
  }

  @Delete('/products/:id')
  async remove(req: WaiterRequest) {
    /* ... */
  }
}

License

MIT

Keywords

framework

FAQs

Package last updated on 02 Nov 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