0.1.2 • Published 8 years ago

schema-in-js v0.1.2

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

schema-in-js

Build Status Coverage Downloads Downloads npm version dependencies dev dependencies License

Write json schema fast in js.

In Developing! Every version has breaking change!

Getting Started

Install it via npm:

npm install schema-in-js

Usage

And include in your project:

import sj from 'schema-in-js';

let schema = {
    name: sj.str.length(10, 5)
};

let jsonSchema = sj.transformToJSONSchema(schema);
console.log(jsonSchema);

// output
{
    type: 'object',
    properties: {
        name: {
            type: 'string',
            maxLength: 10,
            minLength: 5
        }
    },
    required: ['name']
}

License

MIT

0.1.2

8 years ago

0.1.1

8 years ago

1.0.0

8 years ago