Yoman Introduction

Yeoman is one of the coolest kids in the yard, and many respected developers work together to provide a tool that simplifies the setup and management of web application projects

Warning: This post is outdated and may not reflect the current state of the art

Yeoman is one of the coolest kids in the yard, and many respected developers have worked together to provide a tool that simplifies the setup and management of web application projects: learning X different tools takes less time and is consistent Higher performance and ease of use.

There are many attractions in Yeoman, the most important of which are:

  • It is built on rock-solid tools, you can easily access them, and use them quickly and easily. Don't reinvent the wheel.
  • It is a scaffolding tool suitable for most popular frameworks, such as Bootstrap, Ember.js, Angular.js, Backbone.js.
  • Thank youPavilion(Similar to Jam, Volo, Ender's front-end package manager-but better), it has quick installation, uninstallation and fast installation for common libraries such as jQuery, Underscore.js, Modernizer, Mocha, Backbone and any Bower package Update the helper. .
  • It has a built-in test function, you can use mocha for a PhantomJS (headless browser) instance when launched from the command line, or run a test in the browser when you open the test/index.html page in the browser.
  • It provides a python HTTP server to test your code. When the web server is running, it listens for file changes in the project and reloads the browser if the opened page depends on the changed file. Therefore, you don't even need a back end before you start writing front-end code.

Setting up a Yeoman project is easy. First, install it:

$ curl -L get.yeoman.io | sh

Then enter an empty directory and type

$ yeoman init

This will show you a welcome screen and a list of options you want to add to the project.

You can start a new Ember.js project by typing

$ yeoman init ember

This will create a new Ember.js application, create a basic set of models, controllers and views/templates (and their directories), add script tags for all dependencies (jQuery, Handlebars), and create an index based on HTML5. HTML file template projecthttp://html5boilerplate.com/.

You can use Yeoman to guide the project, update dependencies in the project, run tests, etc. And, when the project is ready for deployment, you can use Grunthttps://github.com/cowboy/gruntBuild by calling "yeoman build" in Yeoman, so that it can be reduced, compiling everything for production, linking and minimizing scripts and styles, compressing images, etc.


More devtools tutorials: