
Research
/Security News
jscrambler npm Package Compromised in Supply Chain Attack
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.
json-validator-util
Advanced tools
This is utility package that helps in validating the json schema. It uses ajv package internally to validate
npm i json-validator-util
OR
yarn json-validator-util
// validating through schema directly
import { validator } from 'json-validator-util';
const response = validator.validate(payload, jsonSchema);
if(!response.isValid) {
console.log(response.errors);
}
// validating through schema filename
import { validator } from 'json-validator-util';
validator.initialize({
schemaPath: 'relative/path/to/folder'
})
const response = validator.validate(payload, 'remaining_path/filename.json');
if(!response.isValid) {
console.log(response.errors);
}
// if need to get ajv original error then pass third parameter value as true
const response = validator.validate(first_param, second_param, true);
if(!response.isValid) {
console.log(response.errors); // will print original ajv style error if validation fails
}
import { validator } from 'json-validator-util';
const payload = {
foo: 123,
bar: "value"
};
const jsonSchema = {
"type": "object",
"properties": {
"foo": {
"type": "integer"
},
"bar": {
"type": "string"
}
},
"required": [
"foo"
],
"additionalProperties": false
}
const response = validator.validate(payload, jsonSchema);
if(!response.isValid) {
console.log(response.errors);
}
FAQs
This is utility package that helps in validating the json schema
We found that json-validator-util 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
/Security News
A compromised jscrambler npm release added a malicious preinstall hook that runs hidden native binaries on Linux, macOS, and Windows.

Research
/Security News
A malicious .NET package is typosquatting the Braintree SDK to steal live payment card data, merchant API keys, and host secrets from production apps.

Security News
/Research
Compromised Injective SDK npm version 1.20.21 exfiltrates wallet private keys and mnemonics through fake telemetry functionality.