format-leaf-api-value

1.0.0 • Public • Published

format-leaf-api-value

Convert JS Object to leaf api schema

Installation

$ npm i format-leaf-api-value -S

Usage

const ots = require('format-leaf-api-value');

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

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

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    1

Package Sidebar

Install

npm i format-leaf-api-value

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • forsigner