
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
json-schemify
Advanced tools
Converts any JSON structure to a valid JSON Schema object.
npm install json-schemify --save-dev
const { writeSchema } = require('json-schemify');
writeSchema(json
, filepath
, options
)
Writes to a JSON schema output file.
const json= {
firstName: 'John',
lastName: 'Doe',
age: 21,
}
writeSchema(json, 'schema.json');
json
Any valid JSON.
filepath
The filepath of the file to write.
options
Option | Description |
---|---|
id? | The $id property of the schema |
title? | The title property of the schema |
prettyPrint? | Pretty print Json output |
schemify(json
, options
)
Returns the JSON schema object (rather than writing to file).
const json= {
firstName: 'John',
lastName: 'Doe',
age: 21,
}
const schema = schemify(json);
// do something with schema
console.log(schema);
json
Any valid JSON.
options
Option | Description |
---|---|
id? | The $id property of the schema |
title? | The title property of the schema |
A valid JSON Schema Object (draft-07)
This example returns a basic schema.
{
firstName: 'John',
lastName: 'Doe',
age: 21,
};
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"firstName": { "type": "string" },
"lastName": { "type": "string" },
"age": { "type": "integer" }
}
}
FAQs
Converts a JSON structure to a valid JSON Schema object.
The npm package json-schemify receives a total of 15 weekly downloads. As such, json-schemify popularity was classified as not popular.
We found that json-schemify 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
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.