Code Monkey home page Code Monkey logo

email-validator's Introduction

Hey! Nice to see you.

Welcome to my GitHub page!
I'm Manish, Fullstack developer/Maker from India. I like to learn new technologies and build side projects. Currently building Post2Image.

Things I code with

React Webpack Docker github actions Google Cloud Platform TypeScript Heroku redux GraphQL Sass Styled Components git angular npm html5 Prettier MongoDB Nodejs

Where to find me

Github Twitter LinkedIn NPM Downloads

Open source projects

🎁 Projects ⭐ Stars 📚 Forks 🛎 Issues 📬 Pull requests
Email Validator Stars Forks Issues Pull Requests

From the Gram

Above are the last 3 pictures posted by @manishsaraan!
📈 my github stats

manish

Visit to learn more about me - manishsaraan.com

email-validator's People

Contributors

argonlaser avatar bahamas10 avatar bradmartin avatar dubzzz avatar dxaviud avatar felipenbrito avatar fresheneesz avatar guysaar223 avatar hermawan22 avatar houd1ni avatar larshassler avatar manishsaraan avatar mss-manish avatar philippstucki avatar ppkgtmm avatar renanosf avatar ryan-rowland avatar sembiance avatar surdu avatar svewag avatar swtpumpkin avatar vladturcanu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

email-validator's Issues

Add some explanation to the readme

Could someone add some explanation to the readme as to whether this is built in a way that minimizes either false-positives or false-negatives?

It seems email validation is absurdly more complicated than I would have expected: http://stackoverflow.com/questions/46155/validate-email-address-in-javascript . While it'd be very nice to have a module that conforms exactly to the spec, it may not be feasible either because the spec is bonkers or because real use cases (ie real emails) violate the spec.

In fact, what might be best is to have two validators, one intended to have no false-positives (and thus will have false-negatives) for use in creation of email addresses, and one intended to have no false-negatives (and thus will have false-positives) for use in validation of already-created emails to send emails to. That way real emails that violate the spec can be accommodated without encouraging the same spec violations in future applications.

[email protected] is allowed

Interesting edge case - numbers are allowed after the final dot even though it would always be a sign of an invalid email address - for me it happened while failing to click tab and advance to the following phone number field.

Support IPv6 domain

It seems that not all types of the domain can be validated.
For example

  • [email protected] - should be accepted
  • first.last@[IPv6:::12.34.56.78] - should be accepted

I suggests to update the test regexp to something like this
/^((?:\w+[!#$%&'*+-\/=?^_`{|}~]?\w+)|\w)@((?:(?:\w+[-\.]?)+\w+\.\w+)|(?:\[IPv6:::(?:[0-9]{2}\.){3}[0-9]{2}\]))$/iu

Breaking change in minor update

the arrow function raised the minimum node version to 4. This library previously functioned in older environments. This should be a semver major update. Could 1.2.x be unpublished and bumped to 2.0?

[Feature] Export validation RegEx

Exporting the expression will help a lot as I am already installing the package and it makes sense to use the same expression in my database models rather than just copy-pasting the expression each time.

Provide configuration for character length

It would be great if we can have a configuration option for custom domains. Our email domains are around 75 characters long. I propose something like
{
max: 300,
nameMax: 50,
domainMax: 250,
}

is it ok if i create a PR for this?

"John..Doe"@example.com return false

If quoted, it may contain Space, Horizontal Tab (HT), any ASCII graphic except Backslash and Quote and a quoted-pair consisting of a Backslash followed by HT, Space or any ASCII graphic; it may also be split between lines anywhere that HT or Space appears. In contrast to unquoted local-parts, the addresses ".John.Doe"@example.com, "John.Doe."@example.com and "John..Doe"@example.com are allowed.

https://en.wikipedia.org/wiki/Email_address

Improper length validation

According to RFC-2821, page 54 the character limits are as follows:
path: 256
local-part: 64
domain: 255

I propose the following changes:

index.js
line 13: if(email.length>256)
line 26: if(domainParts.some(function(part) { return part.length>255; }))

The element separator (@) is included in the total length of the path

New npm version release for latest code on github

Hi @manishsaraan,

We are using your npm module - email-validator for basic email validations in our NodeJs based application (https://www.npmjs.com/package/email-validator).

We observed that the module was last published 5 years ago with the version 2.0.4. However there are no tags or releases present in the git repo.

npm version 2.0.4 points to the Git commit - https://github.com/manishsaraan/email-validator/blob/2c16df5e6f79b34ccae1baeb62efaee218eb73ac/index.js

We are getting the following issue in the 2.0.4 version release - the email domain length check allows only 254 characters. But as per some global standards for email, the domain length can be of 255 characters.

We checked the git repository and found that some fixes have been made (for the domain length check) after the last npm publish.

PR where the issue was fixed - #53

Our application works fine with the latest master branch commit (df02ecd).

Can you please review and advise if a new npm version can be released, so that our application can fetch the latest code from npm.

Thanks,
Anupam

TYPO

You have a typo in test.js, there is lenght instead of length.

Missing changelogs and releases

Hi, I am an email-validator user and a developer who wants to keep his apps dependencies up to date. I have to migrate my email-validator from 1.2.3 to 2.0.4. I would like to know what where the breaking changes. I would like to do that without diving into the commits. That would be hard detective work and lots of slow read.

Shall I point to a good example of a release: https://github.com/socketio/socket.io/releases/tag/4.0.0

Update: found CHANGELOG.md but it did not contain any instructions for v1 to v2 migration.

Nice to have features list.

This issue is like TODO and random-access roadmap in one to transform problems and suggestions to the code.
"opt-in" features should be totally optional and tree-shakeable. The list is subject to change.

  • [feat / dev] Use releases to track important changes between versions #60
  • [feat / config] Some configuration #20
  • [feat / important] IPv6 compatibility: #59
  • [feat / important] utf compatibility. Three PRs are open regarding this. One of them is #57
  • [feat / important] Load tests. Due to previous hypothetical changes, it can become slow or an attack vector. Should test execution time against some tricky dataset.
  • [feat / node / opt-in] MX-record validation as opt-in. Influenced by #65
  • [feat] More strict flags and/or allowed symbols somehow. Influenced by #71
  • [feat] Universal esm / commonjs bundling to shake that tree being modern and a bit compatible. Will introduce some runtime requirements bump, hence major release.
  • [feat / easy] #66 Maybe.
  • [feat] Private domain check as a (plugin??). Influenced by #70

Maintenance.

Hi, @manishsaraan ! Do you still maintain the lib? I see, there're a lot of old open issues.
If you just have no time, would you like to share the access to issues and PRs and possibly npm publishing ?
I don't want to create YeT AnOThEr email validation lib, but rather be sure that some of the popular is in my production.

Updating Readme.md

It will be nice if the readme.md says something about the features of the module , like what purpose does it serve etc . I can work on this

Remove "async" version

The async version is a worse API and not asynchronous in any way. It should be removed to simplify the API and make the package smaller.

Provide concise error messages

What about returning an error message to precisely indicate what is wrong with the given value instead of just returning true or false?

Add callback support

well .I have already installed email-validator from npm and it's version is 1.0.3.
I just follow the instruction requiring module and using the "validate" function to my mail-address.
Nothing happens.
=-=Maybe you can change the api to something like e.validate("[email protected]",function(err,res){...}); for debugging?

validate_async() in index.d.ts even though it doesn’t exist

The following program compiles fine but fails at runtime:

import * as EmailValidator from 'email-validator';

EmailValidator.validate_async('[email protected]', (ex, result) => {
  console.log(`valid? ${result}`);
});
ohnobinki@gibby ~/repos/email-validator-play $ ./node_modules/.bin/tsc
ohnobinki@gibby ~/repos/email-validator-play $ node index
/home/ohnobinki/repos/email-validator-play/index.js:4
EmailValidator.validate_async('[email protected]', function (ex, result) {
               ^

TypeError: EmailValidator.validate_async is not a function
    at Object.<anonymous> (/home/ohnobinki/repos/email-validator-play/index.js:4:16)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

I expected it to fail at compile time.

"#" is accepted in email "username"

Hello,
I experienced that an email address like "###[email protected]" is considered as a valid email address.
In the tests, "! #$%|@invalid-characters-in-local.org" is classified as invalidSupported`.
May this be a bug?

Thanks in advance & best regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.