🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@nativescript/appversion

Package Overview
Dependencies
Maintainers
14
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nativescript/appversion

Read the version of your NativeScript app

2.0.0
latest
Source
npm
Version published
Maintainers
14
Created
Source

NativeScript AppVersion

NPM version Downloads Twitter Follow

Read the current Package ID and Version (name and code) of your NativeScript app.

Installation

Run the following command from the root of your project:

tns plugin add @nativescript/appversion

Usage

To use this plugin you must first require / import it:

JavaScript

var appversion = require("@nativescript/appversion");

TypeScript

import * as appversion from "@nativescript/appversion";

getVersionName(Sync)

getVersionNameSync is the same as getVersionName, except it doesn't return a Promise.

JavaScript

  appversion.getVersionName().then(function(v) {
      console.log("Your app's version is: " + v);
  });

TypeScript

  appversion.getVersionName().then((v: string) => {
      console.log("Your app's version is: " + v);
  });

getVersionCode(Sync)

JavaScript

  appversion.getVersionCode().then(function(v) {
      console.log("Your app's version code is: " + v);
  });

TypeScript

  appversion.getVersionCode().then((v: string) => {
      console.log("Your app's version code is: " + v);
  });

getAppId(Sync)

JavaScript

  appversion.getAppId().then(function(id) {
      console.log("Your app's id is: " + id);
  });

TypeScript

  appversion.getAppId().then((id: string) => {
      console.log("Your app's id is: " + id);
  });

Keywords

NativeScript

FAQs

Package last updated on 04 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts