1.1.0 • Published 8 years ago

schemize v1.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

npm version david Build Status

node-schemize

Generates JSON Schema from JSON. This package was inspired by this gem package.

Installation

$ npm install schemize

# if you want to use CLI, please install as global package.
$ npm install -g schemize

CLI

$ schemize --help

  Usage: schemize [options]

  Generates JSON schema from JSON

  Options:

    -h, --help                output usage information
    -V, --version             output the version number
    -i, --input <path>        Input file path
    --pretty [integer|"tab"]  Prettify output JSON

Example:

$ 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

var schemize = require('schemize');

var json = {
  key: "value"
};

console.log(schemize(json));

License

MIT

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.1

8 years ago