PhoneGap: How to Get list of all plugins using Javascript

1k Views Asked by At

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

4

There are 4 best solutions below

0
On

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.

0
On

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

1
On

All PhoneGap Plugins:

As per I understand from your question that you want all the list of PhoneGap plugins which is supported by JavaScript.

Flow the below-mentioned link to find out all the plugins for PhoneGap using javascript.

PhoneGap Plugin List

Hope the answer help's you. Cheers. Happy coding

0
On

@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.