
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
Encapsulate form validation definitions in objects, using the excellent validator module to handle the actual validation and casting.
I missed the form definition pattern Python has adapted with libraries like web.py and wtforms. Being able to declare form schema's in one place, and being able to trust in your controller code that what you're dealing with has already been validate and cast the way you want is pretty great. forro adds these niceties to Javascript land.
var express = require("express"),
app = express(),
forro = require('forro'),
StringField = forro.StringField,
BooleanField = forro.BooleanField,
DateField = forro.DateField;
// ... some code
var AuthForm = forro({
'username': StringField.required().max(32),
'password': StringField.required().length(4, 25),
'remember_me': BooleanField
});
app.post("/login", AuthForm.middleware(), function(req, res){
// Middleware already validated for us
// and sent back a 400 error if validation failed.
// now we can just call out authentication function with
// req.form.val('username') and req.form.val('password')
});
var BookmarkForm = forro({
'url': StringField.required().url(),
'tags': StringField.required().use(function tokenize(str){
return str.split(',').map(function(s){
return s.trim().toLowerCase();
}).filter(function(s){
return s.length > 0;
});
}),
'created_on': DateField.default(DateField.now)
});
app.post("/bookmark", BookmarkForm.middleware(), function(req, res){
saveBookmark(req.form.val('url'), req.form.val('tags'), req.form.val('created_on'), function(err, bookmark){
if(err) return next(err);
res.send(bookmark);
});
});
// ... some more code
npm install forro
git clone
npm install
mocha
MIT
FAQs
WTForms style form validataion for node.js
We found that forro 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
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.