Skip to content
This repository has been archived by the owner on Sep 29, 2020. It is now read-only.
/ is-email-valid Public archive

Check if email is valid with a simple npm plugin

License

Notifications You must be signed in to change notification settings

fintory/is-email-valid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

is-email-valid

Build status

Why another email validator?

We at Fintory often work out sign up processes for companies we work with. In the progress of the conception of the sign up processes, we often need an email address from the user that is signing up. When validating and showing an error message, it is mandatory to have a look at what should be allowed and what not. We wanted to have a basic foundation with a simple regular expression, that validates the most important things of an email address. A non-whitespace string before and after the @ and also one after the .. This is what this package is about.

Usage

The use is really simple, just install the package via npm or yarn and you will be able to do something like this:

import { isEmailValid } from 'is-email-valid'; // Please be aware of the alias `isEmail`

isEmail('nick@fintory.email'); // Returns `true`

It is also possible to use a callback or a promise with the library:

import { isEmailValidPromise } from 'is-email-valid'; // Please be aware of the alias `isEmailPromise`

isEmail('nick@fintory.email') // Returns a promise which resolves in a boolean
  .then(valid => console.log(valid)); // Will `console.log` a true

API

isEmailValid(email[, callback]) => Boolean

isEmail(email[, callback]) => Boolean

isEmailValidPromise(email) => Promise(Boolean)

isEmailPromise(email) => Promise(Boolean)

License (view file)

MIT License

Copyright (c) 2017 Fintory (A venture by Kreativgebiet)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

About

Check if email is valid with a simple npm plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published