Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mifi/cordova-xml
Edit cordova config.xml from the command line or via API
https://github.com/mifi/cordova-xml
Last synced: about 2 months ago
JSON representation
Edit cordova config.xml from the command line or via API
- Host: GitHub
- URL: https://github.com/mifi/cordova-xml
- Owner: mifi
- License: mit
- Created: 2016-08-18T12:06:06.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2020-05-02T05:09:22.000Z (over 4 years ago)
- Last Synced: 2024-05-01T19:40:55.336Z (7 months ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 7
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cordova - cordova-xml
README
# cordova-xml
Edit cordova config.xml from the command line or via API. Uses the awesome [node-xmlpoke](https://github.com/mikeobrien/node-xmlpoke).
## Install
```
npm install --save-dev cordova-xml
```
or global:
```
npm install -g cordova-xml
```## CLI Usage
```
cordova-xml
```## CLI examples
```
cordova-xml setId com.example.myid --config /path/to/config.xml
cordova-xml setVersion 1.2.3
cordova-xml setId com.example.myid
cordova-xml setAndroidVersion 1.4.5
cordova-xml setIosVersion 1.1.2
cordova-xml setName TestApp
cordova-xml setDescription 'my app description'
cordova-xml setAuthorEmail '[email protected]'
cordova-xml setAuthorName 'Author Authsson'
cordova-xml setAuthorWebsite 'http://example.com'
cordova-xml setXml "/w:widget/w:platform[@name='android']" 'hey'
```## lib examples
```
require('cordova-xml')().setId('com.example.myid')
require('cordova-xml')('/path/to/config.xml').setId('com.example.myid')
```## Use xmlpoke directly
```
const cordovaXml = require('cordova-xml')();
cordovaXml.withPoke(xml => xml.add("/w:widget/w:platform[@name='android']/something", xml.XmlString('hey')));
```
See [node-xmlpoke](https://github.com/mikeobrien/node-xmlpoke) for more info.## Related
https://github.com/ragingwind/cordova-config-cli - Inspiration. However this one mutates the XML doc more