Skip to content

CLI and JavaScript API for setting the version in Apache Cordova config.xml

License

Notifications You must be signed in to change notification settings

gligoran/cordova-set-version

Folders and files

NameName
Last commit message
Last commit date
Nov 1, 2023
Dec 7, 2020
Jul 20, 2023
Aug 20, 2020
Jul 5, 2018
Feb 8, 2022
Apr 25, 2018
Feb 10, 2017
Feb 8, 2022
Jul 20, 2023
May 18, 2022
Jan 16, 2025
Mar 13, 2025
Feb 8, 2022

Repository files navigation

cordova-set-version

NPM

ISC License npm version npm downloads build codecov known vulnerabilities semantic-release

Features

  • Writes version and buildNumber to Cordova config.xml
  • Can read version from local package.json
  • Has CLI

Install

$ npm install cordova-set-version

Usage

const cordovaSetVersion = require('cordova-set-version');

cordovaSetVersion(); // reads version from package.json
cordovaSetVersion('2.4.9');
cordovaSetVersion('./config.alt.xml', '2.4.9');
cordovaSetVersion('./config.alt.xml', 86);
cordovaSetVersion('./config.alt.xml', '2.4.9', 86)
    .catch(error => { ... });

API

cordovaSetVersion([configPath], [version], [buildNumber]): Promise

  • configPath (string) - path to your config.xml
  • version (string) - version to be written
  • buildNumber (number) - build number to be written

CLI

cordova-set-version [-v|--version <version>] [-b|--build-number <build-number>] [config.xml]

Options:

  • -v/--version - version to set
  • -b/--build-number - build number to set
  • --help - display help

Examples

$ cordova-set-version
$ cordova-set-version -v 2.4.9
$ cordova-set-version -b 86
$ cordova-set-version -v 2.4.9 -b 86