
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
validation-schema
Advanced tools
validation-schema is a Mongoose inspired express middleware with the purpose of validating and sanitizing JSON requests. It supports custom validate/sanitize with asynchronous capabilities.
Note: validation-schema is still early in development and has many planned features, along with optimization improvements.
npm install validation-schema
A quick example of how validation-schema could be used. View the documentation.
const validationSchema = require('validation-schema')
app.post('/', validationSchema({
username: {
type: 'string', // Data type check
required: [true, 'A username is required'],
minlength: [5, 'Username must be at least 5 characters'],
maxlength: [25, 'Username must be no more than 25 characters']
},
password: { // can use single values for a default error message
type: 'string',
required: true,
minlength: 5
}
}), (req, res, next) => {
// Detailed report of all errors
// Shows error location, error type e.g 'maxlength' and error messages.
console.log(req.valid.errors)
// Nicely formatted array of error messages
console.log(req.valid.errorMessages)
// Validated and sanitized values
console.log(req.valid.values)
})
FAQs
A schema-based validation middleware for JSON requests
The npm package validation-schema receives a total of 1 weekly downloads. As such, validation-schema popularity was classified as not popular.
We found that validation-schema 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
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.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.