Skip to content

Instantly share code, notes, and snippets.

@addyosmani
Created October 1, 2013 11:36
Show Gist options
  • Save addyosmani/6777152 to your computer and use it in GitHub Desktop.
Save addyosmani/6777152 to your computer and use it in GitHub Desktop.
Lesser known Yeoman generators

yo bootstrap

Add Bootstrap to your project with choices including CSS, Sass, Less or Stylus.

Install: npm install generator-bootstrap -g

Usage:

$ yo bootstrap
[?] In what format would you like the Twitter Bootstrap stylesheets? (Use arrow keys)
 css
  sass
  less
  stylus 

yo gruntfile

Scaffolds out a Grunt file for new front-end projects.

Install: npm install generator-gruntfile -g

Usage:

$ yo gruntfile
[?] Is the DOM involved in ANY way? No
[?] Will files be concatenated or minified? Yes
[?] Will you have a package.json file? Yes

yo jquery

Scaffold out a new jQuery plugin with a package.json, dependencies and everything you need to submit a plugin to the jQuery plugin registry.

Install: npm install generator-jquery -g

Usage:

$ yo jquery
For more information, please see the following documentation:

Naming Your Plugin      http://plugins.jquery.com/docs/names/
Publishing Your Plugin  http://plugins.jquery.com/docs/publish/
Package Manifest        http://plugins.jquery.com/docs/package-manifest/

[?] Project Name: carousel
[?] Title: myCarousel
[?] Description: The best carousel ever
[?] Version: 0.1
[?] Repository: git://github.com/addyosmani/carousel
[?] Bugs:
[?] License: MIT
[?] Github Username: addyosmani
[?] Author Name: Addy Osmani
[?] Author Email: addyosmani@gmail.com
[?] jQuery Version: 1.9.1 

yo gruntplugin

Scaffolds out a new Grunt plugin.

Install: npm install generator-gruntplugin -g

Usage:

yo gruntplugin

yo commonjs

Create a commonjs module with yo, including Nodeunit unit tests.

Install: npm install generator-commonjs

Usage:

$ yo commonjs
[?] License: MIT
[?] GitHub username: cat
[?] Author's Name: Cat McCat
[?] Author's Email: [email protected]
[?] Author's Homepage: cat.com
   create src/.jshintrc
   create src/cat.js
   create test/cat_test.js 

yo node

Create a Node.js module with yo, including Nodeunit unit tests.

Install: npm install generator-node

Usage:

$ yo node

The name of your project shouldn't contain "node" or "js" and
should be a unique ID not already in use at search.npmjs.org.
[?] Module Name: butter
[?] Description: the best butter ever
[?] Homepage: http://butter.com
[?] License: MIT
[?] GitHub username: butter
[?] Author's Name: Butter
[?] Author's Email: [email protected]
[?] Author's Homepage: butter.com 
@addyosmani
Copy link
Author

generator-gruntplugin should now have parity with grunt-init-gruntplugin and it should work for Ben's use cases too. grunt will build and test correctly now as well.

https://github.com/yeoman/generator-gruntplugin/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment