# react-native-ram

> test

Latest version **1.0.2** (published 2022-10-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-ram
pnpm add react-native-ram
yarn add react-native-ram
bun add react-native-ram
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-10-08 |
| First published | 2022-10-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 98.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Dragos Todoroscean |
| Maintainers | uniqqum |
| Keywords | react-native, ios, android |

## Links

- npm: https://www.npmjs.com/package/react-native-ram
- Repository: https://github.com/dragoshuniq/react-native-ram
- Homepage: https://github.com/dragoshuniq/react-native-ram#readme
- Issues: https://github.com/dragoshuniq/react-native-ram/issues
- npm.io page: https://npm.io/package/react-native-ram

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

- 1.0.2 (latest) — 2022-10-08
- 1.0.1 — 2022-10-08
- 1.0.0 — 2022-10-08

## README

# react-native-ram

A react-native module to get device RAM

## Installation

#### Using npm:

```sh
npm install react-native-ram
```

#### or using yarn:

```sh
yarn add react-native-ram
```

## Usage

```js
import { getAllRamInfo } from "react-native-ram";

React.useEffect(()=>{
   getAllRamInfo().then(( ramInfo )=> console.log(ramInfo))
},[])


#### OR use async/await

const getRam=async()=>{
 const ramInfo = await getAllRamInfo();
 console.log(ramInfo)
}

// ...result example in MB and %

{
  "appUsedMemory": 12.637718200683594,
  "percentageUsed": 48.736824388734746,
  "usedMemory": 2726.0390625,
  "availableMemory": 2867.34765625,
  "totalMemory": 5593.38671875,
  "percentageAvailable": 51.263175611265254
}

```

## API

| Method                                              | Return Type         | iOS | Android |
| --------------------------------------------------- | ------------------- | :-: | :-----: |
| [getAllRamInfo()](#getallraminfo)                   | `Promise<RamState>` | ✅  |   ✅    |
| [getTotalRam()](#gettotalram)                       | `Promise<number>`   | ✅  |   ✅    |
| [getUsedRam()](#getusedram)                         | `Promise<number>`   | ✅  |   ✅    |
| [getAvailableRam()](#getavailableram)               | `Promise<number>`   | ✅  |   ✅    |
| [getPercentageUsed()](#getpercentageused)           | `Promise<number>`   | ✅  |   ✅    |
| [getPercentageAvailable()](#getpercentageavailable) | `Promise<number>`   | ✅  |   ✅    |
| [getAppRamUsed()](#getappramused)                   | `Promise<number>`   | ❌  |   ✅    |

## Type

```js
interface RamState {
  percentageAvailable: number;
  percentageUsed: number;
  totalMemory: number;
  availableMemory: number;
  usedMemory: number;
  appUsedMemory?: number;
}
```

## License

MIT

---

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