A mongoose schema generator for Yeoman
npm install generator-mongoose
|2||downloads in the last day|
|15||downloads in the last week|
|33||downloads in the last month|
|Version||0.0.4 last updated 3 months ago|
|Keywords||yo, yeoman, generator, yeoman-generator, mongoose, mongodb, schema|
A generator for Yeoman.
What is 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
Sub Generator Schema
Run the sub generator for schemas:
$ yo mongoose:schema "article|title:String,excerpt:String,content:String,published:Boolean,created:Date"
models/ - article.js routes/ - article.js test/ - test-article.js
Getting To Know Yeoman
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.