@express-tool/plugin-middleware
v1.0.2
Published
This plugin provides additional specialized middleware for `express-tool` applications, primarily focusing on request validation using Zod.
Readme
Express Tool Middleware Plugin
This plugin provides additional specialized middleware for express-tool applications, primarily focusing on request validation using Zod.
Installation
Installed automatically when validation features are needed. Manual install:
npm install @express-tool/plugin-middlewareFeatures
- Zod Validation: A generic validation middleware factory that validates
body,query, andparamsagainst Zod schemas. - Type Safety: Ensures request data matches your schema definition before reaching controllers.
Usage
Generates middleware/validate.ts. Import and use it in your routes:
import { validate } from './middleware/validate';
import { someSchema } from './schemas';
router.post('/', validate(someSchema), controller.create);License
MIT
