# vue-props-schema

> 将vue的prop-types转换为Json schema

Latest version **1.0.5** (published 2019-01-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-props-schema
pnpm add vue-props-schema
yarn add vue-props-schema
bun add vue-props-schema
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2019-01-11 |
| First published | 2019-01-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | lgy573 |

## Links

- npm: https://www.npmjs.com/package/vue-props-schema
- Repository: https://github.com/liuguanyu/VueProps2Schema
- Homepage: https://github.com/liuguanyu/VueProps2Schema#readme
- Issues: https://github.com/liuguanyu/VueProps2Schema/issues
- npm.io page: https://npm.io/package/vue-props-schema

## Recent versions

- 1.0.5 (latest) — 2019-01-11
- 1.0.4 — 2019-01-11
- 1.0.3 — 2019-01-11
- 1.0.2 — 2019-01-11
- 1.0.1 — 2019-01-11
- 1.0.0 — 2019-01-10

## README

### 这是什么

将vue的prop-types转换为Json schema

### 如何使用

```Javascript
const props2Schema = require("./props2schema");


let input = `{
	a: {
		c: {
			type: [Number, String],
			required: true,
			default: 0
		},
		d: String,
		e: {
			type: Number,
			required: true
		}
	},
	b: {
		type: String,
		required: true
	},
	f: {
		type: String,
		required: true,
		default: '1'
	}
}`;


let schema =  props2Schema(input); 

/***
{
	"type": "object",
	"properties": {
		"a": {
			"type": "object",
			"properties": {
				"c": {
					"type": ["number", "string"],
					"default": 0
				},
				"d": {
					"type": "string"
				},
				"e": {
					"type": "number"
				}
			},
			"required": ["c", "e"]
		},
		"b": {
			"type": "string"
		},
		"f": {
			"type": "string",
			"default": "1"
		}
	},
	"required": ["b", "f"]
}
***/

```

---
_Source: https://npm.io/package/vue-props-schema · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
