mxab:simple-schema-jsdoc

generates a json schema type


License
MIT
Install
meteor add mxab:simple-schema-jsdoc@=0.1.1

Documentation

Allows to export the simple schema to a js Doc type

var PersonSchema = new SimpleSchema({
    firstName : {
        type : String,
        optional : true
    },
    lastName : {
        type : String
    },
    birthday : {
        type : Date
    },
});

var docString = PersonSchema.jSDocType();

console.log("/** @typedef {%s} %s */", docString, "Person");

//result:
/**
@typedef {{
       firstName:(string|undefined),
       lastName:string,
       birthday:Date
  }} Person
 */

More examples: https://github.com/mxab/simple-schema-jsdoc-example