
Security News
gem.coop Tests Dependency Cooldowns as Package Ecosystems Move to Slow Down Attacks
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.
validator-lite
Advanced tools
Lightweight Form Validation (no dependencies)
$ npm install --save validator-lite
<form id="demo">
<div class="form-control">
<label>Email Address</label>
<input type="email" name="email">
</div>
<div class="form-control">
<label>Password</label>
<input id="pw" type="password" name="password1">
</div>
<div class="form-control">
<label>Confirm Password</label>
<input type="password" name="password2">
</div>
<button type="submit">Register</button>
</form>
<script src="validator.min.js"></script>
<script>
var demo = document.getElementById('demo');
var val = new Validator({
form: demo,
fieldClass: 'form-control',
rules: {
email: {
required: true,
message: 'You must enter an email',
test: 'email'
},
password1: {
required: true,
message: 'You must enter a password',
test: 'password'
},
password2: {
required: true,
test: 'equals'
message: 'Please confirm your password',
arg: function () {
return demo.querySelector('input#pw').value;
}
},
},
onFail: function () {
alert('Please correct all errors!');
},
onPass: function (elem) {
elem.reset();
window.location.href = '/welcome';
}
});
</script>
Add custom tests or override included defaults.
Type: Element
Default: null
Lorem ipsum.
Type: Object
Default: {}
Lorem ipsum.
Type: String
Default: 'error'
Lorem ipsum.
Type: String
Default: 'Required'
Lorem ipsum.
Type: Function
Default: noop
Lorem ipsum.
Type: Function
Default: noop
Lorem ipsum.
MIT © Luke Edwards
FAQs
Lightweight Form Validation (no dependencies)
We found that validator-lite 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
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.

Security News
Following multiple malicious extension incidents, Open VSX outlines new safeguards designed to catch risky uploads earlier.

Research
/Security News
Threat actors compromised four oorzc Open VSX extensions with more than 22,000 downloads, pushing malicious versions that install a staged loader, evade Russian-locale systems, pull C2 from Solana memos, and steal macOS credentials and wallets.