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-compile-time

v0.4.2

Published

Read the version of the App from config.xml and make it available in js.

Downloads

3

Readme

Cordova compile time plugin

This plugin reads information of your app that you put in config.xml and makes it available inside your app via Javascript.

This plugin should work on any platform since it does not rely on any native code.

Installation

Cordova CLI

cordova plugin add cordova-compile-time-plugin

The plugin will then be accessable via window.cordova.compileTime.xxx. xxx include id / name / version / description / author / env.

Usage

config.xml example

<?xml version='1.0' encoding='utf-8'?>
<widget id="my.app.id" version="1.5.0">
  <name>Example App</name>
  <description>
      An example app.
  </description>
  <author email="[email protected]" href="http://vitarn.com">
      ViTarn.com
  </author>
</widget>
window.cordova.compileTime.id == "my.app.id";
window.cordova.compileTime.name == "Example App";
window.cordova.compileTime.version == "1.5.0";
window.cordova.compileTime.description == "An example app.";
window.cordova.compileTime.author == "ViTarn.com";
> cordova build ios --release
window.cordova.compileTime.env == "production"; // "development" if no "--release"

How does it work?

The plugins uses the before_prepare hook to generate javascript files in plugin own www folder which will be added to the App on build. It will clean these generate files after_prepare.

Changelog

  • 0.4.2
    • publish to npm.
  • 0.3.3
    • dont clean because it will fail the other plugins install.
    • commit www. reason same as above.
  • 0.3.0
    • clean after prepare.
  • 0.2.0
    • change namespace to cordova.compileTime.
    • make more infomation available:
      • id
      • name
      • version
      • description
      • author
    • add env.
      • production if --release arg provide. otherwise development.
  • 0.1.0
    • Added namespace version to not override other plugins see issue 2 Call to retrieve the appVersion is now: window.cordova.plugins.version.getAppVersion()
  • 0.0.4
    • Changed directory separators from \\to / see issue 1