Cordova custom plugin

in my app i want to do some background services so i decided to develop custom plugin ,so is there any tool or tutorial available to do this.
thanks in advance

You can do any background service in your app in the .run() controller in the app.js file.