verifly
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Verifly

Installation

npm install verifly

Usage

The Verifly module provides access to functions such as checkNumber, checkString, checkPassword, checkEmail.

For example, see how you can easily validate an email address:

const verifly = require("verifly");

const result = verifly.checkEmail("test@gmail_com");
{
   isValid: false,
   message: 'The string is not a valid email address.'
}

Another example with passwords:

const verifly = require("verifly");

const result = verifly.checkPassword("someRandomPassword", {
    minLength: 8,
    maxLength: 24,
    capitalLetters: 1,
    numbers: 1,
    specialSymbols: 1,
});
{
  isValid: false,
  message: 'The string must have at less 1 number(s).'
}

You can extend the functionality of the checks by adding special presets (your own or built-in verifly.presets)

const result = verifly.checkString("someRandomString", {
    minLength: 6,
    maxLength: 20,
    presets: [{ patterns: ["hello"], minAmount: 1 }],
});
{
  isValid: false,
  message: 'The string must contain the substring "hello" at least 1 time(s).'
}

Package Sidebar

Install

npm i verifly

Weekly Downloads

0

Version

0.2.0

License

MIT

Unpacked Size

34.5 kB

Total Files

40

Last publish

Collaborators

  • yurace