Friday 2 June 2017

Docs generation in Mongoose schema

Let's say I have schema like this:

var schema = new Schema({
  name:    String,
  ofString:   [String],
  ofNumber:   [Number],
  ofMixed:    [Schema.Types.Mixed],
  ofObjectId: [Schema.Types.ObjectId],
  nested: {
    stuff: { type: String, lowercase: true, trim: true }
  }
});

Now, I want to have some docs corresponding to every schema like java-docs. So, when I generate docs for above schema, I'll get something like

Name - Type=String - Optional= true/false

What I want to know is if there is a package/tool which can convert this info markdown file or some way I can do it myself?



via myke_11j

No comments:

Post a Comment