
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
basic-validation
Advanced tools
This module applies basic validation on JSON data in dot cascade notation.
This module applies basic validation on JSON data in dot cascade notation.
var validation = require('basic-validation');
var againstThis = {
title: validation.string().required(),
author: validation.string().allow(['']),
cost: validation.number().valid([1200, 1300]),
publishers: validation.array().items(validation.object().keys({
name: validation.string()
}))
};
var validateThis = {
title: "Conjuring",
author: "MR X",
cost: 1200
};
validation.validate(validateThis, againstThis, function(err, result) {
console.log("err :-", err);
console.log("result :-", result);
});
/*output will be
err:- null
result:- { title: 'Conjuring', author: 'MR X', cost: 1200 }
*/
var againstThis = {
title: validation.string().required(),
author: validation.string().allow(['']),
cost: validation.number().valid([1200, 1300]),
publishers: validation.array().items(validation.object().keys({
name: validation.string()
}))
};
var validateThis = {
author: "MR X",
cost: 1200
};
validation.validate(validateThis, againstThis, function(err, result) {
console.log("err :-", err);
console.log("result :-", result);
});
/*output will be
err:- title is required
result:- undefined
*/
The module was created to apply validation on old node version where some functionality of 'joi' was not compatible;
FAQs
This module applies basic validation on JSON data in dot cascade notation.
We found that basic-validation 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.