As part of the move to npm for plugins described in this post, there is an extra step you need to complete to prepare your plugin for publishing plus there's a new publishing process. All of these steps are described in http://cordova.apache.org/announcements/2015/04/21/plugins-release-and-move-to-npm.htmlhttp://cordova.apache.org/announcements/2015/04/21/plugins-release-and-move-to-npm.html.

Basically, you create the plugin.xml and code your plugin's stuff. Before publishing, open a terminal window and execute the following command:

plugman createpackagejson [PLUGIN DIRECTORY]

This will create the package.json file npm needs to publish your plugin.

Next you'll want to add a readme.md file to the plugin project folder. Populate the file with anything you want your plugin users to know about your plugin.

With those two pieces in place, navigate to the plugin directory and execute the following command to publish your plugin to npm:

npm publish

That's it, that's all there is to it.

The mol plugin from Chapter 16 has been publsihed to https://www.npmjs.com/package/johnwargo-cordova-plugin-mol.You can add it to a project using the following command:

cordova plugin add johnwargo-cordova-plugin-mol

The carrier plugin from Chapter 16 has been published to https://www.npmjs.com/package/johnwargo-cordova-plugin-carrier. you can add it to a project using the following command:

cordova plugin add johnwargo-cordova-plugin-carrier