# @nativescript/appversion

> Read the version of your NativeScript app

Latest version **2.0.0** (published 2020-08-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install @nativescript/appversion
pnpm add @nativescript/appversion
yarn add @nativescript/appversion
bun add @nativescript/appversion
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2020-08-04 |
| First published | 2020-08-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 49 |
| Author | Eddy Verbruggen |
| Maintainers | multishiv19, nativescript-bot, rigor789, davecoffin, nathanaela, bradmartin, walkerrunpdx, rosen_vladimirov, stoskov, rosen-vladimirov, nativescript-user, tns-bot, lini, tachev |
| Keywords | NativeScript, App Version, Version, App ID, AppId, CFBundleVersion, CFBundleShortVersionString |

## Links

- npm: https://www.npmjs.com/package/@nativescript/appversion
- Repository: https://github.com/eddyverbruggen/nativescript-appversion
- Issues: https://github.com/eddyverbruggen/nativescript-appversion/issues
- npm.io page: https://npm.io/package/@nativescript/appversion

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2020-08-04

## README

# NativeScript AppVersion

[![NPM version][npm-image]][npm-url]
[![Downloads][downloads-image]][npm-url]
[![Twitter Follow][twitter-image]][twitter-url]

[npm-image]:http://img.shields.io/npm/v/nativescript-appversion.svg
[npm-url]:https://npmjs.org/package/nativescript-appversion
[downloads-image]:http://img.shields.io/npm/dm/nativescript-appversion.svg
[twitter-image]:https://img.shields.io/twitter/follow/eddyverbruggen.svg?style=social&label=Follow%20me
[twitter-url]:https://twitter.com/eddyverbruggen

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
```js
var appversion = require("@nativescript/appversion");
```

#### TypeScript
```typescript
import * as appversion from "@nativescript/appversion";
```

### getVersionName(Sync)
`getVersionNameSync` is the same as `getVersionName`, except it doesn't return a Promise.

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

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

### getVersionCode(Sync)

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

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

### getAppId(Sync)

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

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

---
_Source: https://npm.io/package/@nativescript/appversion · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
