I am trying to retreive list of all available plugins using Javascript in phoneGap.
Is this possible to get list of available plugins?
Any response will be appreciated.
Thanks
I am trying to retreive list of all available plugins using Javascript in phoneGap.
Is this possible to get list of available plugins?
Any response will be appreciated.
Thanks
This is hard, there is no a easy way.
Some plugins store their function in cordova.plugin, you can check this to retrieve some. Others include their functions in the window global variable...
The only real way I know, is to enter into the CLI
cordova plugin list
Or just check your plugins folder. But this is not in the javascript.
The only way I have in mind right now, is to do a hook, in node, in the before_prepare, which reads the plugin directory, and stores that data somewhere, so you can access it in the javascript.
Good luck
@user2899728,
your question begs a certain amount of ignorance. Cordova/Phonegap uses only HTML, CSS and Javascript. FAQ (last question). So, the real question: where do I get plugins?
There are several respositories.
More plugins are available on github, but they are sources for the "official" or independent that can be used with the "plugin" method. (See plugman)
NOTE: This exclude libraries that may be available on the Internet, such as Jquery, or service-based libraries - like firebase. -- Best of Luck.
Check how cordova.js is registrating the plugins https://github.com/apache/cordova-js/blob/master/src/common/pluginloader.js
You can then iterate through the
<script>
elements after initialisation is complete and log their src.From https://github.com/apache/cordova-js/blob/master/src/common/modulemapper.js you might event get their ids.