📅 You're Invited: Meet the Socket team at RSAC (April 28 – May 1).RSVP
Socket
Sign inDemoInstall
Socket

validity-email

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

validity-email

Validity style validator to ensure that a property is a valid email address.

1.0.0
latest
Source
npm
Version published
Weekly downloads
47
161.11%
Maintainers
1
Weekly downloads
 
Created
Source

validity-email

Validity style validator to ensure that a property is a valid email address.

As part of the modularisation of validity, this replaces the built-in validity.email.

build status dependency status

Installation

npm install --save validity-email

Usage


const schemata = require('schemata')
  , email = require('validity-email')
  , schema = schemata(
    { emailAddress:
      { validators: [ email ] }
    })
  , schemaWithCustomMessage = schemata(
    { emailAddress:
      { validators: [ email.setFailureMessage('#{name} not valid') ] }
    })


schema.validate({}, function (error, errors) {
  console.log(error, errors)
  // null, 'Email Address must be a valid email address'
})

schemaWithCustomMessage.validate({}, function (error, errors) {
  console.log(error, errors)
  // null, 'Email Address not valid'
})

Credits

Paul Serby

License

ISC

FAQs

Package last updated on 29 Sep 2016

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