# jQuery Boilerplate [![Build Status](https://secure.travis-ci.org/jquery-boilerplate/jquery-boilerplate.svg?branch=master)](https://travis-ci.org/jquery-boilerplate/jquery-boilerplate) ![Bower Version](https://badge.fury.io/bo/jquery-boilerplate.svg)
### A jump-start for jQuery plugins development
So, you've tried your hand at writing jQuery plugins and you're comfortable putting together something that probably works. Awesome! Thing is, you think there might be better ways you could be writing them - you've seen them done a number of different ways in the wild, but aren't really sure what the differences between these patterns are or how to get started with them.
This project won't seek to provide a perfect solution to every possible pattern, but will attempt to cover a simple template for beginners and above. By using a basic defaults object, simple constructor for assigning the element to work with and extending options with defaults and a lightweight wrapper around the constructor to avoid issues with multiple instantiations.
1. Include jQuery:
2. Include plugin's code:
3. Call the plugin:
propertyName: "a custom value"
The basic structure of the project is given in the following way:
│ └── index.html
│ ├── jquery.boilerplate.js
│ └── jquery.boilerplate.min.js
│ ├── jquery.boilerplate.coffee
│ └── jquery.boilerplate.js
Contains a simple HTML file to demonstrate your plugin.
This is where the generated files are stored once Grunt runs.
This file is for unifying the coding style for different editors and IDEs.
> Check [editorconfig.org](http://editorconfig.org) if you haven't heard about this project yet.
List of files that we don't want Git to track.
> Check this [Git Ignoring Files Guide](https://help.github.com/articles/ignoring-files) for more details.
> Check [jshint.com](http://jshint.com/about/) if you haven't heard about this project yet.
Definitions for continous integration using Travis.
> Check [travis-ci.org](http://about.travis-ci.org/) if you haven't heard about this project yet.
Contains all automated tasks using Grunt.
> Check [gruntjs.com](http://gruntjs.com) if you haven't heard about this project yet.
Specify all dependencies loaded via Node.JS.
> Check [NPM](https://npmjs.org/doc/json.html) for more details.
#### How did we get here?
Have you got in this repo and still not sure about using this boilerplate?
Well, extending jQuery with plugins and methods is very powerful and can save you and your peers a lot of development time by abstracting your most clever functions into plugins.
[This awesome guide](https://github.com/jquery-boilerplate/boilerplate/wiki/How-did-we-get-here%3F), adapted from [jQuery Plugins/Authoring](http://docs.jquery.com/Plugins/Authoring), will outline the basics, best practices, and common pitfalls to watch out for as you begin writing your plugin.
#### How to publish plugins?
Also, check our guide on [How to publish a plugin in jQuery Plugin Registry](https://github.com/jquery-boilerplate/boilerplate/wiki/How-to-publish-a-plugin-in-jQuery-Plugin-Registry
**Note:** The jQuery Plugin Registry is in read-only mode. New plugin releases will not be processed.
jQuery recommends moving to [npm](https://www.npmjs.com/), using ["jquery-plugin"](https://www.npmjs.com/browse/keyword/jquery-plugin) as the keyword in your package.json. See [how to publish into npm registry](https://gist.github.com/coolaj86/1318304).
jQuery Boilerplate was made with love by these guys and a bunch of awesome [contributors](https://github.com/jquery-boilerplate/boilerplate/graphs/contributors).
[![Zeno Rocha](http://gravatar.com/avatar/e190023b66e2b8aa73a842b106920c93?s=70)](http://zenorocha.com) | [![Addy Osmani](http://gravatar.com/avatar/96270e4c3e5e9806cf7245475c00b275?s=70)](http://addyosmani.com) | [![Helder Santana](http://gravatar.com/avatar/63fb620ee7d14fc91030d4349d189b3e?s=70)](http://heldr.com)
--- | --- | --- | --- | --- | --- | ---
[Zeno Rocha](http://zenorocha.com) | [Addy Osmani](http://addyosmani.com) | [Helder Santana](http://heldr.com)
Check [CONTRIBUTING.md](https://github.com/jquery-boilerplate/boilerplate/blob/master/CONTRIBUTING.md) for more information.
Check [Releases](https://github.com/jquery-boilerplate/jquery-boilerplate/releases) for detailed changelog.
[MIT License](http://zenorocha.mit-license.org/) © Zeno Rocha