A mongoose schema generator for Yeoman
Want to see pretty graphs? Log in now!
npm install generator-mongoose
|2||downloads in the last day|
|12||downloads in the last week|
|78||downloads in the last month|
|Last Published By|
|Version||0.0.6 last updated 17 days ago|
|Keywords||yo, yeoman, generator, yeoman-generator, mongoose, mongodb, schema|
|Dependencies||yeoman-generator, request, chalk|
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"
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
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.