X

LATEST #JQUERY NEWS

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.

Recently Published

article image
»

jQuery Snippets: How to Add/Remove Classes After Delay

In your projects, there can often be instances of wanting to change ...

article image
»

jQuery Snippets: Back to Top Button

One common way to use jQuery is to add a useful and functional ...

article image
»

jQuery .on() Method: the Issue of Dynamically Added Elements

The jQuery .on() method is the recommended way for attaching events ...

article image
»

How to Use jQuery to Test CSS3 Browser Support

The tricky thing about using CSS properties (especially newer ones ...

article image
»

jQuery Snippets: Check/Un-Check All Function

This easy-to-implement jQuery code snippet is super useful, and can ...

article image
»

Useful jQuery Code Snippets for Handling CSS

If you’re not already familiar with code snippets, they are ...

article image
»

Using Method Chaining in jQuery

Using method chaining in jQuery helps to ensure that your code stays ...

article image
»

jQuery’s .children() Method

Just like in CSS, it’s possible to use jQuery to select the ...

article image
»

jQuery’s .click() Method

With jQuery, it’s super easy to make something happen as a result ...