npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cordova-plugin-config-command

v0.0.2

Published

Cordova/Phonegap plugin to run CLI commands defined in config.xml

Downloads

7

Readme

cordova-plugin-config-command plugin Build Status Latest Stable Version Total Downloads

Table of Contents

Overview

This Cordova/Phonegap plugin enables CLI commands to be defined in a project's config.xml and be executed at the various hook points when running Cordova/Phonegap CLI commands.

Why should I use it?

  • If you want to run custom commands during the Cordova build process or on other Cordova CLI commands.
  • For example, if you want to run a custom test suite or validator tool.
  • While you can achieve the same effect by creating your own hook scripts or wrapping the Cordova CLI commands with another tool such as Grunt or Gulp, the intention of this plugin is to provide convenience.

Important note for PhoneGap Build / Intel XDK

Installation

The plugin is registered on npm as cordova-plugin-config-command

To install the plugin using the CLI:

$ cordova plugin add cordova-plugin-config-command --save
$ phonegap plugin add cordova-plugin-config-command --save

Usage

  • The plugin enables you to define <command> elements in the config.xml which the plugin translates into commands which are executed on a given Cordova hook.
  • The <command> elements can either be placed at the top-level (within <widget>) to run across all platforms, or inside <platform> elements to run only for a specific platform operation.
  • One or more <command> elements may be placed in the config.xml. They will be executed in the order they appear in the XML document.

Attributes

  • name (required) - name (and optionally relative/absolute path) of the command to execute.
    • Arguments for the command may optionally be defined here or using the args attribute.
  • hook (required) - Cordova hook on which to execute the command. For a list of available hooks see the Cordova Hooks guide.
  • args (optional) - Arguments for the command may optionally be defined here or within the name attribute.
    • Argument values must be XML-escaped: for example double quotes must be entered as &quot; and ampersands as &amp;.
  • display_output (optional) - If set to true, the console output from the command will be displayed. Defaults to false.
  • abort_on_error (optional) - If set to true, and the command results in a non-zero error code, the Cordova operation will be aborted. Defaults to false.
  • cwd (optional) - The directory from which to execute the command. Defaults to the root of the Cordova project.

Example usage

<command name="echo" args="&quot;My grammar's getting worse &amp; worse&quot"
    hook="before_prepare" display_output="true"/>

<!-- Run npm test script -->
<command name="npm" args="test" hook="before_prepare" display_output="true" abort_on_error="true"/>

<!-- Validate with JSHint -->
<command name="jshint" args="www" hook="after_prepare" display_output="true" abort_on_error="true"/>

<!-- Run Jasmine tests -->
<command name="jasmine" args="spec/*Spec.js" hook="before_prepare" display_output="true" abort_on_error="true"/>

<platform name="android">
    <!-- Run Maven tests -->
    <command name="mvn" args="surefire:test" hook="after_build" display_output="true" abort_on_error="true"/>
</platform>

<platform name="ios">
    <!-- Run Xcode tests -->
    <command
        name="xcodebuild"
        args="test -project platforms/ios/MyApp.xcodeproj -scheme MyApp -destination 'platform=OS X,arch=x86_64'"
        hook="after_build"
        display_output="true"
        abort_on_error="true"
     />

    <!-- Validate build -->
    <command
        name="altool"
        cwd="/Applications/Xcode.app/Contents/Applications/Application\ Loader.app/Contents/Frameworks/ITunesSoftwareService.framework/Support/"
        args="--validate-app --file platforms/ios/build/device/my-app.ipa --username [email protected] --password password"
        hook="after_build"
        display_output="true"
        abort_on_error="true"
    />
</platform>

License

================

The MIT License

Copyright (c) 2016 Dave Alden / Working Edge Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.