Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Feb 29, 2024 via pnpm

json-schema-traverse 0.4.1

Traverse JSON Schema passing each schema object to callback
Package summary
Share
0
issues
1
license
1
MIT
Package created
4 Jun 2017
Version published
10 Jun 2018
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
json-schema-traverse@0.4.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of json-schema-traverse 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does json-schema-traverse do?

Json-schema-traverse is a powerful tool used to traverse a JSON schema, where each schema object is passed to a callback function. Its primary function is to navigate through a JSON schema object and execute provided callback functions on each schema object, providing rich and granular control over the operations you might want to perform on each object.

How do you use json-schema-traverse?

The json-schema-traverse npm package can be incorporated into your JavaScript project in a few simple steps. First, you install the package using npm in your terminal: npm install json-schema-traverse.

Post installation, you can then require and use json-schema-traverse in your JavaScript code. Here's a basic usage example:

const traverse = require('json-schema-traverse');
const schema = {
  properties: {
    foo: {type: 'string'},
    bar: {type: 'integer'}
  }
};

let cb = function(schema, pointer, rootSchema, parentPointer, parentKeyword, parentSchema, indexOrProp){
    console.log(schema);
};

traverse(schema, {cb}); 
// the callback function 'cb' is triggered for each schema object

In this sample code, traverse is called with the schema and an object that contains your callback function cb. This cb function serves as your custom logic that will be applied to each schema object during traversal.

Where are the json-schema-traverse docs?

Documentation for json-schema-traverse is primarily available on its npm package page (https://www.npmjs.com/package/json-schema-traverse) and the GitHub repository (https://github.com/epoberezkin/json-schema-traverse). Here you will find in-depth details about how the package works, usage examples, traverse options, and more. All the information required to understand the functioning of the package can be found on these pages.