I found a lots of discussion about javascript in the web. But there are only few discussions about the guideline for creating a new javascript library.
In one of my project I have used jQuery and created some javascript functions which uses jQuery. Now I want to create a javascript library for those function.
The target is - users who want to use the features implemented by the javascript functions will use it as a library/api (I don’t know what is the right word here).
Can anybody please guide me how I will proceed to achieve this goal?
This involves extending jQuery to create reusable components that can be used on any web page.
You can do this by extending $.fn (an alias for jQuery.prototype) with a function of your own. This function will then be available just like any other jQuery object method.
For example, if you wanted to write a plugin to add random amounts of padding to an element, you could do it like this: