title: Cordova Plugins
body: <p>Can someone explain me how does a structure of a javascript file written to execute a custom plugin work, for example I know that</p>
  
  <pre><code>exec(&lt;success function&gt;,&lt;failure function&gt;,&lt;service&gt;,&lt;action&gt;,&lt;args&gt;)
  </code></pre>
  
  <p>this function is used to call the native where service is the plugin class name and action is the method that needs to be called in that class.
  What I am failing to understand is that what does this structure do for example</p>
  
  <pre><code>cordova.define("cordova/plugin/pluginName",
  function(require,exports,module){
  var exec = require("cordova/exec")
  pluginName.prototype.methodName = function()
  </code></pre>
  
  <p>I am unable to understand what is happening here ?</p>