Emailaddresses.validate()

Determine whether or not the provided string is an email address.

Usage

Hover over inputs/exits for more info.

var Emailaddresses = require('machinepack-emailaddresses');


// Determine whether or not the provided string is an email address.

Emailaddresses.validate({

string: 'foo@foobar.com',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// The provided string is not an email address.

invalid: function () {

 

},

// OK.

success: function () {

 

},

});

Inputs

string required

The email address to validate.

'foo@foobar.com'

Exits

error

An unexpected error occurred.

invalid

The provided string is not an email address.

success

OK.