Skip to content

mohsen1/json-to-json-schema

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON to JSON Schema

Build Status

Convert a JSON to a JSON Schema describing that JSON

Usage

import {convert} from 'json-to-json-schema';

const myJson = {name: 'Mohsen'};

const mySchema = convert(myJson);

console.log(mySchema); // => {type: 'object', properties: {name: {type: 'string'}}}

Installation

Use npm or Bower to install this package

npm install --save json-to-json-schema
bower install --save json-to-json-schema

The browser module supports all UMD module systems. It exposes JSONToJSONSchema global object when there is no module system available.

Development

To install dependencies

npm install

To run tests

npm test

To run tests continuously and watch for changes install mocha and run:

mocha --compilers js:babel/register -w

To make a new browser build run

npm run browserify

License

MIT

About

Convert a JSON to a JSON Schema describing that JSON

Resources

License

Stars

Watchers

Forks

Packages

No packages published