A mongoose schema generator for Yeoman
A generator for Yeoman.
Trick question. It's not a thing. It's this guy:
Basically, he wears a top hat, lives in your computer, and waits for you to tell him what kind of application you wish to create.
Not every new computer comes with a Yeoman pre-installed. He lives in the npm package repository. You only have to ask for him once, then he packs up and moves into your hard drive. Make sure you clean up, he likes new and shiny things.
$ npm install -g yo
While running through a leafy mongodb field he picked up mongoose.
To install generator-mongoose from npm, run:
$ npm install -g generator-mongoose
Finally, initiate the generator:
$ yo mongoose
It should output a file structure similiar to:
.bowerrc .editorconfig .jshintrc config/ - db.js public/ css/ - style.css js/ - script.css models/ - post.js routes/ - index.js - post.js test/ - test-post.js views/ - index.html bower.json Gruntfile.js package.json Readme.md
$ grunt server
$ grunt prod
Run the sub generator for schemas:
$ yo mongoose:schema "article|title:String,excerpt:String,content:String,published:Boolean,created:Date"
Your creating a schema for article With the fields: title,excerpt,content,published,created create routes/article.js create models/article.js starting request to schematic for test mock data... create test/test-article.js
Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced.