# cordova-plugin-uptime

> A Cordova plugin to retrieve the system uptime in milliseconds since boot.

Latest version **0.1.2** (published 2023-11-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install cordova-plugin-uptime
pnpm add cordova-plugin-uptime
yarn add cordova-plugin-uptime
bun add cordova-plugin-uptime
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2023-11-17 |
| First published | 2018-04-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 12.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Silviu Stroe |
| Maintainers | silvius |
| Keywords | ecosystem:cordova, cordova-android, cordova-ios, ionic android uptime, ionic ios uptime, android uptime, ios uptime, system real uptime, cordova uptime, device uptime, monotonic uptime |

## Links

- npm: https://www.npmjs.com/package/cordova-plugin-uptime
- Repository: https://github.com/s1lviu/cordova-plugin-uptime
- Homepage: https://github.com/s1lviu/cordova-plugin-uptime#readme
- Issues: https://github.com/s1lviu/cordova-plugin-uptime/issues
- npm.io page: https://npm.io/package/cordova-plugin-uptime

## 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

- 0.1.2 (latest) — 2023-11-17
- 0.1.1 — 2018-05-13
- 0.1.0 — 2018-04-13
- 0.0.9 — 2018-04-07
- 0.0.8 — 2018-04-06
- 0.0.7 — 2018-04-06
- 0.0.6 — 2018-04-04
- 0.0.5 — 2018-04-04
- 0.0.4 — 2018-04-04
- 0.0.3 — 2018-04-03
- 0.0.2 — 2018-04-03
- 0.0.1 — 2018-04-03

## README

# cordova-plugin-uptime

This plugin provides the system uptime in milliseconds since boot, allowing developers to track how long a device has been running. This can be particularly useful for monitoring, diagnostics, or adding uptime information within an application.

## Installation

```bash
$ ionic cordova plugin add cordova-plugin-uptime
$ npm install --save @ionic-native/uptime
```

## Supported Platforms

- Android
- iOS

## Usage

**Ionic Framework 2+ - TypeScript**

```typescript
import { Uptime } from '@ionic-native/uptime';  

constructor(private uptime: Uptime) { }  

// ...

this.uptime.getUptime(includeDeepSleep)
  .then((uptime) => console.log('Uptime (ms): ', uptime))
  .catch((error) => console.log('Error: ', error));
```

**ES5 usage:**

```javascript
Uptime.getUptime(includeDeepSleep,
    function(uptime) { 
        console.log('Uptime (ms): ', uptime);
    },
    function(err) {  
        console.log('Error: ', err);
    }
);
```

The `includeDeepSleep` is a boolean parameter. If set to true, the returned uptime includes the total uptime (including device sleeping time). Otherwise, it will be the uptime considering clock stops when the system enters deep sleep (CPU off, display dark, device waiting for external input), but is not affected by clock scaling, idle, or other power-saving mechanisms.

## Contributing

If you would like to contribute to this plugin, please feel free to submit a pull request or open an issue on our [GitHub repository](https://github.com/s1lviu/cordova-plugin-uptime).

## Author

This plugin is made with :heart: by [Silviu Stroe](https://silviu-s.com/)

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.

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