1.2.5 • Published 11 months ago

@errikrose/input-utils v1.2.5

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

input-utils

A collection of validation middlewares for Express applications.

Installation

Install the package using npm:

npm install @errikrose/input-utils

Usage

Middleware

You can use the provided middlewares in your Express routes to validate input data.

Here's an example of how to use the validateEmail middleware:

const express = require("express");
const { validateEmail } = require("@errikrose/input-utils");

const app = express();

app.post("/signup", validateEmail, (req, res) => {
  // Handle the signup route logic
});

// Add more routes with other validation middlewares

app.listen(3000, () => {
  console.log("Server is running on port 3000");
});

Available Middlewares

  • validateEmail: Validates the email field in the request body.
  • validatePhone: Validates the phone field in the request body.
  • validateBirthday: Validates the birthday field in the request body.
  • validatePassword: Validates the password field in the request body.

License

This package is licensed under the ISC License.

1.2.5

11 months ago

1.2.4

11 months ago

1.2.3

11 months ago

1.2.2

11 months ago

1.2.1

11 months ago

1.2.0

11 months ago

1.1.0

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago