{"id":21540029,"url":"https://github.com/robinpowered/react-native-vitals","last_synced_at":"2025-04-10T03:26:46.746Z","repository":{"id":57341297,"uuid":"108578169","full_name":"robinpowered/react-native-vitals","owner":"robinpowered","description":"Memory and resource information Native Module for React Native","archived":false,"fork":false,"pushed_at":"2019-12-06T21:22:53.000Z","size":62,"stargazers_count":56,"open_issues_count":3,"forks_count":4,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-03-24T04:43:39.759Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robinpowered.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-27T18:00:29.000Z","updated_at":"2024-04-24T12:34:35.000Z","dependencies_parsed_at":"2022-09-14T04:31:20.356Z","dependency_job_id":null,"html_url":"https://github.com/robinpowered/react-native-vitals","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinpowered%2Freact-native-vitals","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinpowered%2Freact-native-vitals/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinpowered%2Freact-native-vitals/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robinpowered%2Freact-native-vitals/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robinpowered","download_url":"https://codeload.github.com/robinpowered/react-native-vitals/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248150069,"owners_count":21055851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T04:17:02.210Z","updated_at":"2025-04-10T03:26:46.724Z","avatar_url":"https://github.com/robinpowered.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-vitals\n\nReact Native package that provides memory/storage usage info of a device.\n\n## Usage\n```javascript\nimport Vitals from 'react-native-vitals';\n\nVitals.getMemory().then(memory =\u003e {\n  var {\n    appUsed,\n    systemTotal,\n    systemFree,\n    systemUsed\n  } = memory;\n});\n\nVitals.getStorage().then(storage =\u003e {\n  var {\n    total,\n    free,\n    used\n  } = storage;\n});\n\nVitals.addLowMemoryListener(memory =\u003e {\n  console.log('Low memory warning triggered');\n  var {\n    appUsed,\n    systemTotal,\n    systemFree,\n    systemUsed\n  } = memory;\n})\n```\n\n## Getting started\n\n`$ npm install react-native-vitals --save`\n\n### Mostly automatic installation\n\n`$ react-native link react-native-vitals`\n\n### Manual installation\n\n\n#### iOS\n\n1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`\n2. Go to `node_modules` ➜ `react-native-vitals` and add `RNVitals.xcodeproj`\n3. In XCode, in the project navigator, select your project. Add `libRNVitals.a` to your project's `Build Phases` ➜ `Link Binary With Libraries`\n4. Run your project (`Cmd+R`)\n\n#### iOS (using [CocoaPods](https://cocoapods.org/))\n\nAlternatively, you can use CocoaPods to manage your native dependencies, just add this inside your `Podfile`:\n```\n  pod 'react-native-vitals', :path =\u003e '../node_modules/react-native-vitals'\n```\n\nAfter adding this, you need to run `pod install` inside the `ios`-folder of your RN application.\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainActivity.java`\n  - Add `import com.robinpowered.react.vitals.RNVitalsPackage;` to the imports at the top of the file\n  - Add `new RNVitalsPackage()` to the list returned by the `getPackages()` method\n2. Append the following lines to `android/settings.gradle`:\n  \t```\n  \tinclude ':react-native-vitals'\n  \tproject(':react-native-vitals').projectDir = new File(rootProject.projectDir, \t'../node_modules/react-native-vitals/android')\n  \t```\n3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n  \t```\n      compile project(':react-native-vitals')\n  \t```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinpowered%2Freact-native-vitals","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobinpowered%2Freact-native-vitals","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobinpowered%2Freact-native-vitals/lists"}