{"id":13402753,"url":"https://github.com/apache/cordova-plugman","last_synced_at":"2025-05-15T18:11:29.125Z","repository":{"id":7908121,"uuid":"9290694","full_name":"apache/cordova-plugman","owner":"apache","description":"Apache Cordova Plugman","archived":false,"fork":false,"pushed_at":"2024-04-13T14:53:14.000Z","size":6464,"stargazers_count":402,"open_issues_count":24,"forks_count":152,"subscribers_count":41,"default_branch":"master","last_synced_at":"2025-04-25T08:02:32.087Z","etag":null,"topics":["cordova","cplusplus","csharp","hacktoberfest","java","javascript","library","mobile","nodejs","objective-c"],"latest_commit_sha":null,"homepage":"https://cordova.apache.org/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-04-08T07:20:20.000Z","updated_at":"2025-04-14T19:27:30.000Z","dependencies_parsed_at":"2024-06-18T12:37:55.215Z","dependency_job_id":"88e32a82-0891-416d-93bd-d229c2cf1679","html_url":"https://github.com/apache/cordova-plugman","commit_stats":{"total_commits":984,"total_committers":65,"mean_commits":"15.138461538461538","dds":0.8526422764227642,"last_synced_commit":"f4f49d0c3b7f04e10489d69ef61bb6c25cb04ba0"},"previous_names":[],"tags_count":65,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcordova-plugman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcordova-plugman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcordova-plugman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fcordova-plugman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/cordova-plugman/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251767523,"owners_count":21640544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cordova","cplusplus","csharp","hacktoberfest","java","javascript","library","mobile","nodejs","objective-c"],"created_at":"2024-07-30T19:01:20.407Z","updated_at":"2025-05-15T18:11:29.089Z","avatar_url":"https://github.com/apache.png","language":"JavaScript","readme":"\u003c!--\n#\n# Licensed to the Apache Software Foundation (ASF) under one\n# or more contributor license agreements.  See the NOTICE file\n# distributed with this work for additional information\n# regarding copyright ownership.  The ASF licenses this file\n# to you under the Apache License, Version 2.0 (the\n# \"License\"); you may not use this file except in compliance\n# with the License.  You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing,\n# software distributed under the License is distributed on an\n# \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n#  KIND, either express or implied.  See the License for the\n# specific language governing permissions and limitations\n# under the License.\n#\n--\u003e\n\n# plugman\n\n[![Node CI](https://github.com/apache/cordova-plugman/actions/workflows/ci.yml/badge.svg)](https://github.com/apache/cordova-plugman/actions/workflows/ci.yml)\n[![codecov.io](https://codecov.io/github/apache/cordova-plugman/coverage.svg?branch=master)](https://codecov.io/github/apache/cordova-plugman?branch=master)\n\nA command line tool to install and uninstall plugins for use with [Apache Cordova](http://cordova.io) projects.\n\nThis document defines tool usage.\n\n## Requirements\n\nYou must have `git` on your PATH to be able to install plugins directly from remote git URLs.\n\n## Plugin Specification\n\n--\u0026gt; [Available on docs.cordova.io](http://cordova.apache.org/docs/en/latest/plugin_ref/spec.html) \u0026lt;--\n\n## Quickstart\n\n    npm install -g plugman\n\n## Design Goals\n\n* Facilitate programmatic installation and manipulation of plugins\n* Detail the dependencies and components of individual plugins\n* Allow code reuse between different target platforms\n\n## Supported Platforms\n\n* Amazon Fire OS\n* Android\n* BlackBerry 10\n* iOS\n* Tizen\n* Windows Phone 8\n* Windows 8\n\n## Command Line Usage\nDisplay all available plugman commands:\n\n    plugman help\n\n### Plugin Management\n\nInstall a plugin into a Cordova project: \n\n    plugman install --platform \u003cios|amazon-fireos|android|blackberry10|wp8\u003e --project \u003cdirectory\u003e --plugin \u003cname|url|path\u003e [--plugins_dir \u003cdirectory\u003e] [--www \u003cdirectory\u003e] [--variable \u003cname\u003e=\u003cvalue\u003e [--variable \u003cname\u003e=\u003cvalue\u003e ...]]\n\nUninstall a Plugin from a Cordova project:\n\n\tplugman uninstall --platform \u003cios|amazon-fireos|android|blackberry10|wp8\u003e --project \u003cdirectory\u003e --plugin \u003cid\u003e [--www \u003cdirectory\u003e] [--plugins_dir \u003cdirectory\u003e]\n\nFor each command (install and uninstall), you must specify a platform and Cordova project location for that platform. You also must specify a plugin, with the different `--plugin` parameter forms being:\n\n  * `name`: The directory name where the plugin contents exist. This must be an existing directory under the `--plugins_dir` path (see below for more info) or a plugin in the Cordova registry.\n  * `url`: A URL starting with https:// or git://, pointing to a valid git repository that is clonable and contains a `plugin.xml` file. The contents of this repository would be copied into the `--plugins_dir`.\n  * `path`: A path to a directory containing a valid plugin which includes a `plugin.xml` file. This path's contents will be copied into the `--plugins_dir`.\n\nOther parameters:\n\n* `--plugins_dir` defaults to `\u003cproject\u003e/cordova/plugins`, but can be any directory containing a subdirectory for each fetched plugin.\n* `--www` defaults to the project's `www` folder location, but can be any directory that is to be used as cordova project application web assets.\n* `--variable` allows to specify certain variables at install time, necessary for certain plugins requiring API keys or other custom, user-defined parameters. Please see the [plugin specification](plugin_spec.md) for more information.\n\n### Registry Search\n\nSearch the [Plugin registry](http://plugins.cordova.io) for plugin id's that match the given space separated list of keywords.\n\n    plugman search \u003cplugin keywords\u003e\n\n### Configuration Management:\n\nDisplay the current list of configuration settings:\n\n\tplugman config ls\n\nDisplay the current repository endpoint:\n\n    plugman config get registry\n\nSet the registry endpoint:\n\n    plugman config set registry \u003curl-to-registry\u003e\n\nYou should leave this set to http://registry.cordova.io, unless you want to use a third party plugin registry.\n\n## Node Module Usage\nThis section details how to consume Plugman as a node module and is only for Cordova tool authors and other hackers. You should not need to read this section if you are just using Plugman to manage a Cordova project.\n\n    node\n    \u003e require('plugman')\n    { install: [Function: installPlugin],\n      uninstall: [Function: uninstallPlugin],\n      fetch: [Function: fetchPlugin],\n      search: [Function: search],\n      publish: [Function: publish],\n      unpublish: [Function: unpublish],\n      adduser: [Function: adduser],\n      prepare: [Function: handlePrepare],\n      create: [Function: create],\n      platform: [Function: platform] }\n\n### `install` method\n\n    module.exports = function installPlugin(platform, project_dir, id, plugins_dir, subdir, cli_variables, www_dir, callback) {\n\nInstalls a plugin into a specified cordova project of a specified platform.\n\n * `platform`: one of `amazon-fireos`, `android`, `ios`, `blackberry10`, or `wp8`\n * `project_dir`: path to an instance of the above specified platform's cordova project\n * `id`: a string representing the `id` of the plugin, a path to a cordova plugin with a valid `plugin.xml` file, or an `https://` or `git://` url to a git repository of a valid cordova plugin or a plugin published to the Cordova registry\n * `plugins_dir`: path to directory where plugins will be stored, defaults to `\u003cproject_dir\u003e/cordova/plugins`\n * `subdir`: subdirectory within the plugin directory to consider as plugin directory root, defaults to `.`\n * `cli_variables`: an object mapping cordova plugin specification variable names (see [plugin specification](plugin_spec.md)) to values\n * `www_dir`: path to directory where web assets are to be copied to, defaults to the specified project directory's `www` dir (dependent on platform)\n * `callback`: callback to invoke once complete. If specified, will pass in an error object as a first parameter if the action failed. If not and an error occurs, `plugman` will throw the error\n\n### `uninstall` method\n\n    module.exports = function uninstallPlugin(platform, project_dir, id, plugins_dir, cli_variables, www_dir, callback) {\n\nUninstalls a previously-installed cordova plugin from a specified cordova project of a specified platform.\n\n * `platform`: one of `amazon-fireos`, `android`, `ios`, `blackberry10`, or `wp8`\n * `project_dir`: path to an instance of the above specified platform's cordova project\n * `id`: a string representing the `id` of the plugin\n * `plugins_dir`: path to directory where plugins are stored, defaults to `\u003cproject_dir\u003e/cordova/plugins`\n * `subdir`: subdirectory within the plugin directory to consider as plugin directory root, defaults to `.`\n * `cli_variables`: an object mapping cordova plugin specification variable names (see [plugin specification](plugin_spec.md)) to values\n * `www_dir`: path to directory where web assets are to be copied to, defaults to the specified project directory's `www` dir (dependent on platform)\n * `callback`: callback to invoke once complete. If specified, will pass in an error object as a first parameter if the action failed. If not and an error occurs, `plugman` will throw the error\n\n### `fetch` method\n\nCopies a cordova plugin into a single location that plugman uses to track which plugins are installed into a project.\n\n    module.exports = function fetchPlugin(plugin_dir, plugins_dir, link, subdir, git_ref, callback) {\n\n * `plugin_dir`: path, URL to a plugin directory/repository or name of a plugin published to the Cordova registry.\n * `plugins_dir`: path housing all plugins used in this project\n * `link`: if `plugin_dir` points to a local path, will create a symbolic link to that folder instead of copying into `plugins_dir`, defaults to `false`\n * `subdir`: subdirectory within the plugin directory to consider as plugin directory root, defaults to `.`\n * `gitref`: if `plugin_dir` points to a URL, this value will be used to pass into `git checkout` after the repository is cloned, defaults to `HEAD`\n * `callback`: callback to invoke once complete. If specified, will pass in an error object as a first parameter if the action failed. If not and an error occurs, `plugman` will throw the error\n\n### `prepare` method\n\nFinalizes plugin installation by making configuration file changes and setting up a JavaScript loader for js-module support.\n\n    module.exports = function handlePrepare(project_dir, platform, plugins_dir) {\n\n * `project_dir`: path to an instance of the above specified platform's cordova project\n * `platform`: one of `amazon-fireos`, `android`, `ios`, `blackberry10`, or `wp8`\n * `plugins_dir`: path housing all plugins used in this project\n\n## Registry related actions\n\n### `adduser` method\n\nAdds a user account to the registry. Function takes no arguments other than a an optional callback\n\n    module.exports = function(callback) {\n\n### `publish` method\n\nPublishes plugins to the registry. `plugin_paths` is an array of plugin paths to publish to the registry.\n\n    module.exports = function(plugin_paths, callback) {\n\n### `unpublish` method\n\nunpublishes plugins from the registry. Can unpublish a version by specifying `plugin@version` or the whole plugin by just specifying `plugin`. `plugins` is an array of `plugin[@version]` elements.\n\n    module.exports = function(plugins, callback) {\n\n### `search` method\n\nSearches plugins in the registry. `search_opts` is an array of keywords\n\n    module.exports = function(search_opts, callback) {\n\n### `config` method\n\nConfigures registry settings. `params` is an array that describes the action\n    /*\n    * var params = ['get', 'registry'];\n    * var params = ['set', 'registry', 'http://registry.cordova.io'];\n    * module.exports = function(params, callback) {\n    */\n\n## Create plugin related actions\n\n### `create` method\n\nCreates basic scaffolding for a new plugin\n\n  module.exports = function create( name, id, version, pluginPath, options, callback ) {...}\n\n* `name` : a name for the plugin\n* `id` : an id for the plugin\n* `version` : a version for the plugin\n* `pluginPath` : a path to create the plugin in\n* `options` : an array of options\n* `callback` : callback to invoke once complete. If specified, will pass in an error object as a first parameter if the action failed. If not and an error occurs, `plugman` will throw the error\n\n### `platform` method\n\nAdd/Remove a platform from a newly created plugin\n\n  module.exports = function platform( { operation: operation, platform_name: cli_opts.platform_name } );\n\n* `operation` : \"add or remove\"\n* `platform_name` : ios, android\n\n## Example Plugins\n\n- Google has a [bunch of plugins](https://github.com/MobileChromeApps/mobile-chrome-apps/tree/master/chrome-cordova/plugins) which are maintained actively by a contributor to plugman\n- Adobe maintains plugins for its Build cloud service, which are open sourced and [available on GitHub](https://github.com/phonegap-build)\n- BlackBerry has a [bunch of plugins](https://github.com/blackberry/cordova-blackberry/tree/master/blackberry10/plugins) offering deep platform integration\n- Core and 3rd party plugins can be found on the [Cordova Registry](http://plugins.cordova.io).\n\n## Development\n\nBasic installation:\n\n    git clone https://git-wip-us.apache.org/repos/asf/cordova-plugman.git\n    cd cordova-plugman\n    npm install -g\n\nLinking the global executable to the git repo:\n\n    git clone https://git-wip-us.apache.org/repos/asf/cordova-plugman.git\n    cd cordova-plugman\n    npm install\n    sudo npm link\n\n### Running Tests\n\n    npm test\n\n## Plugin Directory Structure\n\nA plugin is typically a combination of some web/www code, and some native code.\nHowever, plugins may have only one of these things - a plugin could be a single\nJavaScript file, or some native code with no corresponding JavaScript.\n\nHere is a sample plugin named foo with android and ios platforms support, and 2 www assets.\n\n```\nfoo-plugin/\n|- plugin.xml     # xml-based manifest\n|- src/           # native source for each platform\n|  |- android/\n|  |  `- Foo.java\n|  `- ios/\n|     |- CDVFoo.h\n|     `- CDVFoo.m\n|- README.md\n`- www/\n   |- foo.js\n   `- foo.png\n```\n\nThis structure is suggested, but not required.\n\n## Contributors\n\nSee the [package.json](package.json) file for attribution notes.\n\n## License\n\nApache License 2.0\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fcordova-plugman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fcordova-plugman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fcordova-plugman/lists"}