Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
scniro-validator
Advanced tools
a small, dependency-free email validator with configurable rules and suggested corrections
npm install scniro-validator --save
var v = require('scniro-validator');
var result = v.validate('foo@bar.com');
// {valid: true}
validation may be influenced by calling optional .init
with a configuration object
var rules = {
tld: {
allowed: ['com']
sdl: {
allowed: ['bar']
}
}
var result = v.validate('foo@baz.com');
// {valid: false}
validation will include a suggested correction base on corrections
defined via tld
and sld
supplied match
objects (top-level domain and second-level domain, respectively). Specify this via tryCorrect
.
var rules = {
tld: {
allowed: ['com'],
corrections: [
{match: 'con.au', correct: 'com'}
]
}
}
var result = v.validate('foo@bar.con.au', {tryCorrect: true});
// {valid: false, correction: 'foo@bar.com'}
or a really barged example
var rules = {
tld: {
allowed: ['com'],
corrections: [
{match: 'con.au', correct: 'com'}
]
},
sdl: {
allowed: ['bar']
}
}
var result = v.validate('foo.bar.con.au', {tryCorrect: true});
// {valid: false, correction: 'foo@bar.com'}
e-mail validation is a rabbit whole, and this tool does not aim to be a silver bullet. The capability of this tool is influenced from the w3c type="email"
validation, ships with some extensibility specific to a business defined problem, and is pessimistic in nature. For a less problem-specific validation tool, check out the awesome mailcheck.js
FAQs
a simple email validator with corrective action capabilities
The npm package scniro-validator receives a total of 3 weekly downloads. As such, scniro-validator popularity was classified as not popular.
We found that scniro-validator 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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.