0.1.2 • Published 7 years ago

schema-in-js v0.1.2

Weekly downloads
9
License
MIT
Repository
github
Last release
7 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

7 years ago

0.1.1

7 years ago

1.0.0

7 years ago