🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

json-schema-view-js

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json-schema-view-js

JSON Schema View core library

2.0.1
latest
Source
npm
Version published
Maintainers
1
Created
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

json

FAQs

Package 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