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
»

How to Dynamically Trim Text Using jQuery

This easy beginners jQuery tutorial demonstrates how you can use ...

article image
»

jQuery Snippets: Getting the Current Year

Here’s a fun, simple, and incredibly useful jQuery that you can ...

article image
»

jQuery Snippets: How to Conditionally Enable Submit

One easy way to prevent users from submitting an empty form in a ...

article image
»

How to Use Google Analytics with jQuery Mobile

jQuery Mobile is an HTML5 based web-page framework that’s ...

article image
»

jQuery Snippets: Using jQuery to Check All Boxes

When you’ve given your users a ton of checkbox input fields ...

article image
»

Useful jQuery Code Snippets for Working with Images

Images are an essential part of any website and sometimes working ...

article image
»

How to Use jQuery to Check if Cookies are Enabled

A cookie (not the kind with chocolate chips) is a small piece of data ...

article image
»

A Beginner’s Guide to jQuery’s Selectors

We talk a lot about event methods on this site, but not so much about ...

article image
»

Add Keyboard Shortcut to Anchor Tag Using jQuery

Making a user friendly website can be quite a challenging task. There ...