open-index/open-npm huggingface dataset:
npm package: @slowinskip/randomid-generator
Description: Install with:   yarn add @slowinskip/randomid-generator                 npm install @slowinskip/randomid-generator
Latest version: 1.0.1

Install with:   yarn add @slowinskip/randomid-generator
                npm install @slowinskip/randomid-generator

Import to your project with: const randomID = require('@slowinskip/randomid-generator');

Use with randomID(x) where x is the length of ID that you want to receive.
npm package: @slowmoe17/express-decorators
Description: A decorator-based middleware system for Express.js applications
Latest version: 1.0.0

# Express Decorators

A decorator-based middleware system for Express.js applications that provides a clean and intuitive way to define routes, middleware, and parameter handling.

## Installation

```bash
npm install express-decorators
```

## Features

- HTTP method decorators (@Get, @Post, @Put, @Delete, @Patch)
- Middleware decorator for applying Express middleware
- Parameter decorators for accessing request body, URL parameters, and query parameters

## Usage

```javascript
import { Get, Post, Middleware, Body, Param, Query, createController } from 'express-decorators';
import express from 'express';

// Example middleware
const auth = (req, res, next) => {
  // Your authentication logic here
  next();
};

class UserController {
  @Get('/users')
  @Middleware(auth)
  async getUsers(@Query('page') page) {
    return { users: [], page };
  }

  @Post('/users')
  async createUser(@Body() userData) {
    return { message: 'User created', user: userData };
  }

  @Get('/users/:id')
  async getUser(@Param('id') id) {
    return { userId: id };
  }
}

const app = express();
app.use(express.json());
app.use('/api', createController(UserController));

app.listen(3000, () => console.log('Server running on port 3000'));
```

## API Reference

### HTTP Method Decorators

- `@Get(path)`: Handle GET requests
- `@Post(path)`: Handle POST requests
- `@Put(path)`: Handle PUT requests
- `@Delete(path)`: Handle DELETE requests
- `@Patch(path)`: Handle PATCH requests

### Middleware Decorator

- `@Middleware(...middlewares)`: Apply Express middleware functions to a route

### Parameter Decorators

- `@Body(param?)`: Access request body or a specific body parameter
- `@Param(param?)`: Access URL parameters or a specific URL parameter
- `@Query(param?)`: Access query parameters or a specific query parameter

### Controller Factory

- `createController(ControllerClass)`: Create an Express router from a controller class

## License

MIT