Socket
Book a DemoInstallSign in
Socket

email-validator-qs

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

email-validator-qs

An email validator including quoted string for local part

1.0.1
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

email-validator

A simple module to validate an email address.

The validator supports quoted-string for the "local" part of the email address (as stated in RFC3696).

  • dot ., provided that it is not the first or last character unless quoted, and provided also that it does not appear consecutively unless quoted (e.g. John..Doe@example.com is not allowed but "John..Doe"@example.com is allowed)

  • space and special characters "(),:;<>@[] are allowed with restrictions (they are only allowed inside a quoted string, as described in the paragraph below, and in addition, a backslash or double-quote must be preceded by a backslash);

Installation

Install via NPM:

npm install email-validator-qs

Usage

javascript


var validator = require("email-validator-qs");

validator.validate('test@email.com'); // true
validator.validate('another.test@email.com'); // true
validator.validate('another..test@email.com'); // false
validator.validate('"another..test"@email.com'); // true
validator.validate('"anot\her..test"@email.com'); // false
validator.validate('"anot\\her..test"@email.com'); // true
validator.validate('"anot"her..test"@email.com'); // false
validator.validate('"anot\"her..test"@email.com'); // true

TypeScript


import * as EmailValidator from 'email-validator-qs';

EmailValidator.validate('test@email.com'); // true
EmailValidator.validate('another.test@email.com'); // true
EmailValidator.validate('another..test@email.com'); // false
EmailValidator.validate('"another..test"@email.com'); // true
EmailValidator.validate('"anot\her..test"@email.com'); // false
EmailValidator.validate('"anot\\her..test"@email.com'); // true
EmailValidator.validate('"anot"her..test"@email.com'); // false
EmailValidator.validate('"anot\"her..test"@email.com'); // true

Contribute

Contributions welcome! Check the LICENSE file for more info.

Meta

This library was originally forked from: https://github.com/manishsaraan/email-validator by Manish Saraan Thank you!

Distributed under the unlicense public domain. See LICENSE for more information.

https://github.com/tomgazit/email-validator-qs

Keywords

email

FAQs

Package last updated on 19 Feb 2020

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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.