New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

form-fields-checker

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

form-fields-checker

npm package to validate form fields like email, phone etc, check password strength, suggest new passwords, and make the form field validation process much easier

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
39
decreased by-4.88%
Maintainers
1
Weekly downloads
 
Created
Source

from-validator

npm package to validate form fields like email, phone no etc, check password strength, suggest new passwords, get country code and initials of all countries and so on. Make the form field validation process much easier and faster. To install the package run

npm i form-validator

As of now there are three main functions, isValidEmail, checkPasswordStrength and generatePassword. Detail explaination of them are given below.

isValidEmail()

If an email is sent as a parameter to this function, it validates wheather the email is valid or not.

checkPasswordStrength()

This functions checks the strength of the given password and returns how strong it is and a list suggetions to further strengthen the password. Strength can be one of these values invalid | weak | moderate | strong | very strong The parameters fo the function is explained below.

ParamTypeAbout
passwordstringthe password that is being checked
minLengthnumberminimum length of the password, default 8
maxLengthnumbermaximum length of the password
disbleBothCasebooleanif it is not mandatory to have both upper and lowercase letters in the password
disbleSpecialCharsbooleanif it is not mandatory to have special characters in the password
disbleNumericbooleanif it is not mandatory to have numbers in the password
forbiddedWords[string]if there are words that cannot be present in the password. e.g. password cannot contain the word 'password'

generatePassword()

This function generates and returns a string password. And if some specific type of character is not wanted in the password that can also be mentioned. The parameters fo the function is explained below.

ParamTypeAbout
minLengthnumberminimum length of the password, default 8
maxLengthnumbermaximum length of the password, default 15
avoidSpecialCharbooleanin case special characters not needed in the password
avoidNumericbooleanin case numbers not needed in the password
avoidUpperCasebooleanin case capital letters not needed in the password
avoidLowerCasebooleanin case lower case letters not needed in the password

Example

License

ISC

FAQs

Package last updated on 12 Feb 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc