Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
is-email-maybe
Advanced tools
Sort-of-strong, but also loose email address validator which uses the same regex as Angular 1.
Hey, I just met you, and this is crazy, but here's my address. isEmailMaybe
? Sort-of-strong, but also loose email
address validator which uses the same regex as Angular 1.
Email validation is hard. You'll probably always get it wrong. The most sure way to validate that an email is valid is by sending it something. Most of the time this works great. If someone wants to sign up for you newsletter, you just let them type whatever they want, then you send them an email and ask them to click on a link to validate they got your email.
However, there are some cases where you really need to protect from human error. In my specific scenario, if the user enters an incorrect email, they could send hundreds of dollars to the wrong person. Or think that they paid their bill on time, but find out too late that they made a typo in the email address.
When doing email validation, you should weigh the costs of getting it wrong. If your validation is over-ambitiously validating an email address, that could lead to some serious frustration on the part of the end user and they may not subscribe to your newsletter (for example), so you may as well make validation as loose as possible (don't use this). However, if you have a scenario like mine where a typo can lead to serious mistakes, then a more ambitious validation solution is probably good.
This is a direct copy/paste from the Angular 1 code here. It's not perfect, but it does a pretty good job of validating 99% of use cases. And it's definitely been battle tested across hundreds of thousands of Angular applications throughout the world.
This module is distributed via npm which is bundled with node and should
be installed as one of your project's dependencies
:
npm install --save is-email-maybe
You can also get it from npmcdn.com: https://npmcdn.com/is-email-maybe
const isEmailMaybe = require('is-email-maybe')
isEmailMaybe('a@b.c') // true
isEmailMaybe('a@@b.c') // false
isEmailMaybe.regex.test('email@example.com') // true
/.+\@.+\..+/
Thanks goes to these people (emoji key):
Kent C. Dodds 💻 📖 🚇 ⚠️ |
---|
This project follows the all-contributors specification. Contributions of any kind welcome!
MIT
FAQs
Sort-of-strong, but also loose email address validator which uses the same regex as Angular 1.
The npm package is-email-maybe receives a total of 1,044 weekly downloads. As such, is-email-maybe popularity was classified as popular.
We found that is-email-maybe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.