
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
A structural Node.js validation module.
This module will protect your application from invalid inputs!

npm install parry
Or, you can use in browser through the browserify.
var Field = require('parry').Field;
var Form = require('parry').Form;
var UsernameField = Field.extend()
.type('matches', /[-_a-z0-9]/i)
.type('isLength', [4, 16])
;
var PasswordField = Field.extend()
.type('isAlphanumeric')
.type('isLength', [8, 16])
;
var GenderField = Field.extend({ passIfEmpty: true })
.type('isIn', ['male', 'female'])
;
var UserForm = Form.extend()
.field('username', UsernameField)
.field('password', PasswordField)
.field('gender', GenderField)
;
// Validate inputs
var inputs = {
username: 'my-username@',
password: 'abcd123',
gender: 'man'
};
var userForm = new UserForm(inputs);
userForm.validate(function(err, validationResult) {
console.log(validationResult);
// -> {
// isValid: false,
// errors: {
// username: [ 'Not matched' ],
// password: [ 'String is not in range' ],
// gender: [ 'Unexpected value' ]
// },
// reporter: { ErrorReporter instance }
// }
});
You can set the following typical validations.
var SubField = Field.extend();
.type('isEmail');
.type('isLength', [4, 64])
;
Use it, in the case of complex validation.
var SubField = Field.extend()
.specify(function(input, callback) {
if (input === 'good') {
callback(null, { isValid: true });
} else if (input === 'bad') {
callback(null, { isValid: false, errorMessages: ['It is a bad input'] });
} else {
// Error message is 'It is a not good input'
callback(null, { isValid: false });
}
}, 'It is a not good input')
;
Pass validation if value is empty.
Default: false
var SubField = Field.extend({ passIfEmpty: true });
Validate all validators already even if error occurs.
Default: false
var SubField = Field.extend({ shouldValidateAll: true });
Create sub class.
var SubField = Field.extend({ passIfEmpty: true, shouldValidateAll: true });
Validate with input.
field.validate('your input', function(err, { isValid, errorMessages }) {
});
Or, if you use promise:
field.validate('your input').then(..);
Set Field sub class with id.
Please see Usage.
Create sub class.
var SubForm = Field.extend({ shouldValidateAll: true });
Validate all fields already even if error occurs
Default: true
var SubForm = Form.extend({ shouldValidateAll: true });
Input a value.
form.input('email', 'foo@example.com');
Input values.
form.inputs({
email: 'foo@example.com',
username: 'foo'
});
Or,
var form = new SubForm({
email: 'foo@example.com',
username: 'foo'
});
Validate fields with inputs.
Please see Usage.
Or, if you use promise:
form.validate().then(..);
FAQs
A structural Node.js validation module
We found that parry 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
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.