Socket
Socket
Sign inDemoInstall

sane-email-validation

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sane-email-validation

Sanely validate email addresses, based on HTML5's definition of email addresses


Version published
Weekly downloads
3K
decreased by-5.6%
Maintainers
1
Install size
15.7 kB
Created
Weekly downloads
 

Readme

Source

Sane Email Validation

There are lots of email address validation modules, but none of them seem to check for sane email addresses. This one does. If you don't agree, please file an issue and convince me why.

Installation

npm install sane-email-validation

Usage

const isEmail = require('sane-email-validation')
const email = '...'

if (isEmail(email)) {
  console.log(`${email} is valid.`)
} else {
  console.log(`${email} is not valid.`)
}

isNotEmail()

An inverted check is also exposed.

const isNotEmail = require('sane-email-validation').isNotEmail
const email = '...'

if (isNotEmail(email)) {
  console.log(`${email} is not valid.`)
} else {
  console.log(`${email} is valid.`)
}

isAsciiEmail()

An ASCII only version of the validator.

Since internationalized email addresses are not fully supported by all infrastructure, some systems may want to limit what they consider valid. See International email and the Email Address Internationalization on Wikipedia for more information.

const isAsciiEmail = require('sane-email-validation').isAsciiEmail
const email = '...'

if (isAsciiEmail(email)) {
  console.log(`${email} is valid.`)
} else {
  console.log(`${email} is not valid.`)
}

isNotAsciiEmail()

An inverted check is also exposed for the ASCII only version.

const isNotAsciiEmail = require('sane-email-validation').isNotAsciiEmail
const email = '...'

if (isNotAsciiEmail(email)) {
  console.log(`${email} is not valid.`)
} else {
  console.log(`${email} is valid.`)
}

License

Copyright Sane Email Validation contributors. Released under the terms of the MIT license.

Keywords

FAQs

Last updated on 07 Apr 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc