https://github.com/pirosikick/node-schemize
Generates JSON Schema from JSON
https://github.com/pirosikick/node-schemize
Last synced: 3 months ago
JSON representation
Generates JSON Schema from JSON
- Host: GitHub
- URL: https://github.com/pirosikick/node-schemize
- Owner: pirosikick
- Created: 2015-12-15T13:38:53.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-20T02:27:29.000Z (over 9 years ago)
- Last Synced: 2025-02-26T15:54:17.560Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](http://badge.fury.io/js/schemize)
[](https://david-dm.org/pirosikick/node-schemize)
[](https://travis-ci.org/pirosikick/node-schemize)node-schemize
=============Generates JSON Schema from JSON.
This package was inspired by [this gem package](https://github.com/kenchan/schemize).## Installation
```sh
$ npm install schemize# if you want to use CLI, please install as global package.
$ npm install -g schemize
```## CLI
```sh
$ schemize --helpUsage: schemize [options]
Generates JSON schema from JSON
Options:
-h, --help output usage information
-V, --version output the version number
-i, --input Input file path
--pretty [integer|"tab"] Prettify output JSON
```Example:
```sh
$ echo '{ "key": "value" }' > example.json# Input from stdin
$ cat example.json | schemize
{"type":"object","properties":{"key":{"type":"string"}}}# Input from file
$ schemize -i example.json
{"type":"object","properties":{"key":{"type":"string"}}}# Prettify output JSON format
$ schemize -i example.json --pretty
{
"type": "object",
"properties": {
"key": {
"type": "string"
}
}
}
```## Programmatic API
```javascript
var schemize = require('schemize');var json = {
key: "value"
};console.log(schemize(json));
```## License
[MIT](http://pirosikick.mit-license.org/)