1.0.1 • Published 6 years ago

@mind029/json2schema v1.0.1

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

json2schema

JSON文件或者JavaScript对象转换成JSON-SCHEMA校验规则对象。

安装

npm install @mind029/json2schema --save

Node.js 用法

const Convert = require("@mind029/json2schema")
const c = new Convert()
const data = {
  id:1,
  name:"mind",
  age:18
}
// 生成的schema结构
const schema = c.format(data)