Git Product home page Git Product logo

sync-cordova-xml's Introduction

sync-cordova-xml

Sync Cordova's XML files with your package.json

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

sync-cordova-xml's People

Contributors

emilbayes avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

nphyatt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.