Skip to content

nphyatt/sync-cordova-xml

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sync-cordova-xml2

Sync Cordova's XML files with your package.json This is a fork of sync-cordova-xml updated to use xml-js

Usage

var sync = require('sync-cordova-xml')

sync(require('./package.json'), xmlString, 'plugin')

This module will synchronise:

  • .version => /@version
  • .name => /name
  • .description => /description

For application it will attemt to set:

  • .displayName => /name, display name being a cordova convention

For plugins it will additionally attempt to set:

  • .name => /@id. Note that as a quirk, cordova will trim the npm scope off this when installing. This plugin will remove scope from the /@id to avoid the issue

  • .license => /license

  • .keywords[] => /keywords joined to comma delimited string

  • .repository.url => /repo (OR simply use .repository if string)

  • .bugs.url => /issue

  • .author as string will be parsed into the next properties

  • .author.name => /author

  • .author.url => /author/@href

  • .author.email => /author/@email

CLI

sync-cordova-xml [--plugin|--config] [--output=plugin.xml] package.json plugin.xml

NOTE: For convenience the CLI will guess the mode from the 2nd argument filename. To absolutely force either mode, regardless of filename, use the one of the flags.

You can add this script to your package.json for automatic sync on each npm version:

"version": "sync-cordova-xml package.json config.xml --output=config.xml && git add config.xml"

API

var resultXml = sync(json, sourceXml, [mode])

Install

npm install sync-cordova-xml

License

ISC

About

Sync Cordova's XML files with your package.json

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%