https://github.com/pharma71/capacitor-disk-space
https://github.com/pharma71/capacitor-disk-space
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/pharma71/capacitor-disk-space
- Owner: pharma71
- Created: 2025-03-07T15:47:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-07T16:26:28.000Z (over 1 year ago)
- Last Synced: 2025-03-07T17:30:14.184Z (over 1 year ago)
- Language: Java
- Size: 95.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# Capacitor Disk Space Plugin
A Capacitor plugin to retrieve disk space information on Android and iOS.
## Installation
```sh
npm install capacitor-disk-space
npx cap sync
```
## Usage
```ts
import { DiskSpace } from 'capacitor-disk-space';
async function checkDiskSpace() {
const info = await DiskSpace.getDiskSpace();
console.log(`Total: ${info.total} bytes`);
console.log(`Free: ${info.free} bytes`);
console.log(`Used by App: ${info.usedByApp} bytes`);
}
checkDiskSpace();
```
## API
### `getDiskSpace()`
Returns an object containing:
- `total`: Total disk space in bytes.
- `free`: Free disk space in bytes.
- `usedByApp`: Space used by the app in bytes.
## License
MIT
* [`getDiskSpace()`](#getdiskspace)
* [Interfaces](#interfaces)
### getDiskSpace()
```typescript
getDiskSpace() => Promise
```
**Returns:** Promise<DiskSpaceInfo>
--------------------
### Interfaces
#### DiskSpaceInfo
| Prop | Type |
| ------------------ | ------------------- |
| **`totalSpace`** | number |
| **`freeSpace`** | number |
| **`appUsedSpace`** | number |