![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
cordova-common
Advanced tools
Apache Cordova tools and platforms shared routines
The cordova-common package provides a set of utilities and shared functionality for Apache Cordova tools. It includes features for handling configuration files, managing plugins, and other common tasks needed for building and maintaining Cordova applications.
Handling Configuration Files
This feature allows you to parse and manipulate Cordova configuration files (config.xml). The code sample demonstrates how to load a config.xml file, change the app name, and save the changes.
const ConfigParser = require('cordova-common').ConfigParser;
const config = new ConfigParser('path/to/config.xml');
config.setName('MyApp');
config.write();
Plugin Management
This feature provides utilities for managing Cordova plugins. The code sample shows how to retrieve information about a specific plugin using the PluginInfoProvider.
const PluginInfoProvider = require('cordova-common').PluginInfoProvider;
const pluginInfoProvider = new PluginInfoProvider();
const pluginInfo = pluginInfoProvider.get('path/to/plugin');
console.log(pluginInfo.id);
Event Emitting
This feature allows you to use an event system for logging and other purposes. The code sample demonstrates how to listen for and emit log events.
const events = require('cordova-common').events;
events.on('log', (message) => console.log(message));
events.emit('log', 'This is a log message');
cordova-lib is the core library for Apache Cordova, providing the main functionality for creating and managing Cordova projects. It includes many of the same utilities as cordova-common but also offers additional features for project creation and platform management.
cordova-plugin-compat is a compatibility library for Cordova plugins, ensuring they work across different versions of Cordova. While it focuses on plugin compatibility, it shares some overlapping functionality with cordova-common in terms of plugin management.
cordova-fetch is a utility for fetching Cordova plugins and platforms. It is more specialized compared to cordova-common, focusing specifically on the retrieval and installation of plugins and platforms.
Expoeses shared functionality used by cordova-lib and Cordova platforms.
events
Represents special instance of NodeJS EventEmitter which is intended to be used to post events to cordova-lib and cordova-cli
Usage:
var events = require('cordova-common').events;
events.emit('warn', 'Some warning message')
There are the following events supported by cordova-cli: verbose
, log
, info
, warn
, error
.
CordovaError
An error class used by Cordova to throw cordova-specific errors. The CordovaError class is inherited from Error, so CordovaError instances is also valid Error instances (instanceof
check succeeds).
Usage:
var CordovaError = require('cordova-common').CordovaError;
throw new CordovaError('Some error message', SOME_ERR_CODE);
See CordovaError for supported error codes.
ConfigParser
Exposes functionality to deal with cordova project config.xml
files. For ConfigParser API reference check ConfigParser Readme.
Usage:
var ConfigParser = require('cordova-common').ConfigParser;
var appConfig = new ConfigParser('path/to/cordova-app/config.xml');
console.log(appconfig.name() + ':' + appConfig.version());
PluginInfoProvider
and PluginInfo
PluginInfo
is a wrapper for cordova plugins' plugin.xml
files. This class may be instantiated directly or via PluginInfoProvider
. The difference is that PluginInfoProvider
caches PluginInfo
instances based on plugin source directory.
Usage:
var PluginInfo: require('cordova-common').PluginInfo;
var PluginInfoProvider: require('cordova-common').PluginInfoProvider;
// The following instances are equal
var plugin1 = new PluginInfo('path/to/plugin_directory');
var plugin2 = new PluginInfoProvider().get('path/to/plugin_directory');
console.log('The plugin ' + plugin1.id + ' has version ' + plugin1.version)
ActionStack
Utility module for dealing with sequential tasks. Provides a set of tasks that are needed to be done and reverts all tasks that are already completed if one of those tasks fail to complete. Used internally by cordova-lib and platform's plugin installation routines.
Usage:
var ActionStack = require('cordova-common').ActionStack;
var stack = new ActionStack()
var action1 = stack.createAction(task1, [<task parameters>], task1_reverter, [<reverter_parameters>]);
var action2 = stack.createAction(task2, [<task parameters>], task2_reverter, [<reverter_parameters>]);
stack.push(action1);
stack.push(action2);
stack.process()
.then(function() {
// all actions succeded
})
.catch(function(error){
// One of actions failed with error
})
superspawn
Module for spawning child processes with some advanced logic.
Usage:
var superspawn = require('cordova-common').superspawn;
superspawn.spawn('adb', ['devices'])
.progress(function(data){
if (data.stderr)
console.error('"adb devices" raised an error: ' + data.stderr);
})
.then(function(devices){
// Do something...
})
xmlHelpers
A set of utility methods for dealing with xml files.
Usage:
var xml = require('cordova-common').xmlHelpers;
var xmlDoc1 = xml.parseElementtreeSync('some/xml/file');
var xmlDoc2 = xml.parseElementtreeSync('another/xml/file');
xml.mergeXml(doc1, doc2); // doc2 now contains all the nodes from doc1
The APIs listed below are also exposed but are intended to be only used internally by cordova plugin installation routines.
PlatformJson
ConfigChanges
ConfigKeeper
ConfigFile
mungeUtil
git clone https://git-wip-us.apache.org/repos/asf/cordova-lib.git
cd cordova-lib/cordova-common
npm install && npm link
cd ../cordova-lib && npm link cordova-common && npm install
FAQs
Apache Cordova tools and platforms shared routines
The npm package cordova-common receives a total of 19,036 weekly downloads. As such, cordova-common popularity was classified as popular.
We found that cordova-common demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 19 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.