Using Yeoman for jQuery

Yeoman is a web scaffolding tool for creating modern web app. Which means it provides project structure to start with, loads all the dependencies and prescribe best practices.  It’s quite useful for everyone as it saves time. So in this post, learn how to use Yeoman for creating jQuery plugin.

To use Yeoman, you need to use npm. Npm is nothing but node js package manager console. First install node.js. You can download it here. Once it is installed then, go to command prompt and type “npm” command to see if it is installed properly.

Next, you need to install Yeoman. The Yeoman is composed of three tools: yo (a scaffolding tool), Grunt/Gulp (A JavaScript task runner and a build tool) and Bower, a package manager (alternatives are available).

So to install Yeoman with all 3 tools, run following command.

npm install -g yo bower grunt-cli gulp

Now, the next step is to install a generator. A generator will provide you the basic structure and all dependencies. And for every language/framework/Application, there is a separate generator. So for jQuery plugin, we need to install a jquery generator. Run below command to install this generator.

npm install --global generator-jquery

Once installed, now run below command to create jQuery plugin structure.

yo jquery

And it will prompt for plugin name, description, version, jQuery version, git user name, email, project name. Once you provide all the details your project is ready.

Similarly, you can also create jQuery mobile application. All you need to do is to install jquery-mobile generator.

npm install -g generator-jquery-mobile

Once installed, now run below command to create jQuery plugin structure.

yo jquery-mobile

You can also use Yeoman for other language like AngularJs, ASP.NET and for basic web development purpose.



Responsive Menu
Add more content here...