2.2.3 • Published 5 years ago

express-validations v2.2.3

Weekly downloads
18
License
ISC
Repository
github
Last release
5 years ago

express-validations

npm Status Build Status Known Vulnerabilities Code Standard HitCount

npm package

NPM package that provides almost all types of validation methods

Upgrade Notice

If you're arriving here as a express-validations v1 user, please check the Usage Guide in order to find out what's we provide!

Installation

  $ npm install express-validations

Usage

  var expressValidations = require('express-validations');
  var email = 'demouser@gmail.com';
  var firstname = 'demouser';
  var minLength = 3;
  var maxLength = 25;

  if (expressValidations.isValidEmail(email)) {
    // if email address is valid
  } else {
    // if email address is invalid
  }

  expressValidations.isValidFirstname(firstname);
  // returns true, if firstname is valid

  expressValidations.isLength('String Length', minLength, maxLength)
  // returns true, if length is between specified range
  // If you have only maxLength criteria, use null for minLength

Complete List of Validation Methods

  • isValidEmail(email)
  • isValidFirstname(firstname)
  • isValidMiddlename(middlename)
  • isValidLastname(lastname)
  • isValidFullname(fullname)
  • isStrongPassword(password)
  • isValidDate(date)
  • isAlpha(alphabeticString)
  • isNumeric(numericString)
  • isAlphaNumeric(alphaNumericString)
  • containsNotNumber(nonNumericString)
  • containsNotAlphabets(nonAlphabeticString)
  • isLength(string, minLength, maxLength)
  • isValidURL(url)

License

ISC License

2.2.3

5 years ago

2.2.2

5 years ago

2.2.1

5 years ago

2.1.1

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.3.6

5 years ago

1.3.5

5 years ago

1.3.4

5 years ago

1.3.3

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago