1.0.1 • Published 6 years ago

leaf-jts v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

leaf-jts

Convert JS Object to leaf api schema

Installation

$ npm i leaf-jts -S

Usage

const jts = require('leaf-jts');

const obj = {
  id: 100,
  owner: {
    show: true,
    login: 'japsu',
  },
  name: 'Tom',
  books: [
    {
      name: 'Hackers and Painters',
      author: 'Paul Graham',
    },
  ],
};

const jsonSchema = jts.json(obj);
const apiSchema = jts.api(obj);

console.log(JSON.stringify(jsonSchema, null, 2));