Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
praetorian
Advanced tools
Praetorian is a structured JSON validator. It take both a JSON data set and a structure and tells you if anything, whats wrong with it.
$ npm install praetorian
Example:
{
"shield": {
"required": true
"validation": {
}
},
"weapon": {
"required": true
"type": "array",
"items": {
"sword": {
"validation": {
}
},
"dagger": {
"required": true
}
}
},
"helmet": {
"type": "object",
"properties": {
"noseGuard": {
"required": true
},
"chinStrap": {
}
}
}
}
Notes:
var Praetorian = require( '../index' );
praetorian = new Praetorian();
// pass your data and structure in like this
praetorian.validate( data, structure, function( err, data ) {
if( err ) {
console.log( 'check err', err );
// requirements will tell you for the passed structure
// how to fulfill the validation
praetorian.requirements( structure, function( err, data ) {
if( err ) {
// console.log( 'requirements err', err );
} else {
// console.log( 'requirements success', data );
}
} );
} else {
console.log( 'check success', data );
}
} );
To run the test harness do the following:
cd praetorian
node test/sanity.js
FAQs
A structured JSON parser and validator
The npm package praetorian receives a total of 4 weekly downloads. As such, praetorian popularity was classified as not popular.
We found that praetorian 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.