
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.
valid8 is a Javascript data validator for use with user input from web forms, APIs, etc.
npm install valid8
mocha
var Valid8 = require('valid8');
var valid8 = new Valid8('form', {
name: 'string',
username: {
type: 'string',
max: 20,
required: true
},
email: 'emailString',
age: {
type: 'int',
min: 18,
required: true
},
gpa: {
type: 'decimal',
},
gender: {
type: 'enum',
options: ['male', 'female']
}
});
var result = valid8.areFieldsValid({
name: 'Aiham',
username: 'averylonglonglongusername',
email: 'invalid email',
age: 17,
gpa: '1.23',
gender: 'foobar'
});
/* result contains:
{
username: 'long',
email: 'format',
age: 'small',
gender: 'option'
}
*/
new Valid8([testType], [fields])
testType - either strict or form (see below)fields - An object containing the field definitionsisFieldValid(name, value)
name - Name of the field to be validatedvalue - Value to be validatedtrue if the field is validareFieldsValid(values, [fieldWhiteList])
values - An object containing the values for each field to be validatedfieldWhiteList - An array of field names to be validated. For when you only want to validate a subset of the fieldstrue if all values are validValid8.testTypes.strict - Checks value and data type. (Default)Valid8.testTypes.form - Checks value even if data is provided in strings. Good for web formsValid8.fieldTypes.stringValid8.fieldTypes.emailStringValid8.fieldTypes.dateStringValid8.fieldTypes.intValid8.fieldTypes.decimalValid8.fieldTypes.enumValid8.errors.missingValid8.errors.longValid8.errors.shortValid8.errors.largeValid8.errors.smallValid8.errors.formatValid8.errors.dataTypeValid8.errors.optionFAQs
Javascript data validator for use with user input from web forms, APIs, etc.
We found that valid8 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.