Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
valid-email
Advanced tools
Regular expression validation is often useful, but also often inaccurate. Sometimes it's just better to do it manually.
console.log(require('valid-email')('john@iamjohnhenry.com'))//#true
console.log(require('valid-email')('iamjohnhenry.com'))//#false
There are some cases in which this library present the user with false negatives (See this issue.
This library is considered a "good enough" implementation for most use cases and is meant to provide a simple method of validating email about which most coders can reason.
There are other methods which may be more accurate but more difficult ensure that it's doing what it's doing. (See https://emailregex.com/).
Please be aware of the levels of accuracy your application needs.
This code is compiled from untested code found on stackoverflow and is mainly intended for academic purposes. Use at your own risk.
Much thanks to @davisjam for helping me to patch a recent security vunerability https://github.com/johnhenry/valid-email/issues/4 .
FAQs
Test the validity of an email address
We found that valid-email 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.