Socket
Socket
Sign inDemoInstall

json-schema-view-js

Package Overview
Dependencies
2
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-schema-view-js


Version published
Maintainers
1
Install size
1.00 MB
Created

Readme

Source

JSON Schema View (Pure JavaScript)

A pure JavaScript component for rendering JSON Schema in HTML.

JSON Schema is very verbose and hard to read in JSON. This component helps rendering a JSON Schema in a user readable format.

Also available as an AngularJS directive

Usage

Installation

Install via bower

bower install json-schema-view-js --save

Then use global JSONSchemaView constructor

const schema = {type: 'string', title: 'Name'};

const view = new JSONSchemaView(schema);

document.body.appendChild(view.render());

API

JSONSchemaView(schema [, open ] [, options])
schema (Object) - required

The JSON Schema object.

open (Number)

Default: 1 This number indicates up to how many levels the rendered tree should expand. Set it to 0 to make the whole tree collapsed or set it to Infinity to expand the tree deeply

options ('Object')

An object containing other options for construction the view. These are possible options:

theme (string)

A theme defined in the CSS of this view. Possible values: dark. Note that the dark theme is just for making the text brighter so it looks good on dark backgrounds.

Development

Install gulp and run gulp serve to start the server that serves the development version of the project.

Running tests

Once:

npm test

Continues:

gulp test

License

MIT

Keywords

FAQs

Last updated on 21 Sep 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc