If you've built React Native apps for long enough, you've probably fought with file downloads, uploads, and filesystem management.
Historically, the community relied on rn-fetch-blob or react-native-fs. While these libraries were absolute lifesavers in their prime, they haven't aged gracefully. They often lack active maintenance, struggle with background persistence, and require a lot of manual boilerplate to manage things like download queues or multipart uploads.
Even expo-file-system, while excellent for the basics, can fall short when you need advanced queueing or robust background management without writing custom native code.
That's why I built rn-file-toolkit.
What is rn-file-toolkit?
rn-file-toolkit is the ultimate, unified native file management toolkit for React Native & Expo. It's designed to be the modern replacement for legacy file libraries.
Built entirely with modern native implementations (Kotlin for Android, Swift for iOS) and zero third-party dependencies, it taps directly into OS-level managers (URLSession on iOS, DownloadManager on Android) to provide maximum reliability and battery efficiency.
Key Features That Will Make Your Life Easier:
- Drop-in React Hooks (
useDownload): No more manual event listeners and state management. You get rich progress tracking (speed, ETA, percentages) and controls (pause, resume, cancel) right out of the box. - True Background Readiness: Downloads and uploads survive app suspension and automatic re-attachment when the user opens the app again.
- Smart Queueing: Need to download 50 images? You can cap concurrency and set priorities with a simple config object. No need to build your own queueing system.
- Resilient Auto-Retries: Network flaked? The library handles auto-retries with exponential backoff and HTTP resume.
- Zero-Dependency Zip/Unzip: Extract archives or compress user data directly on the device natively.
- First-Class Expo Support: Works seamlessly with Expo custom dev clients. An Expo config plugin is included automatically.
Quick Example: Using useDownload
Here’s how simple it is to download a large video file and show progress, speed, and ETA:
import React from 'react';
import { View, Text, Button } from 'react-native';
import { useDownload } from 'rn-file-toolkit';
export default function DownloadScreen() {
const { start, pause, resume, cancel, status, progress, result } = useDownload();
return (
<View style={{ padding: 20 }}>
<Button
title="Start Download"
onPress={() =>
start({
url: 'https://example.com/large-video.mp4',
destination: 'documents',
})
}
/>
{status === 'downloading' && progress && (
<View style={{ marginTop: 20 }}>
<Text>Progress: {progress.percent.toFixed(1)}%</Text>
<Text>Speed: {(progress.speedBps / 1024 / 1024).toFixed(2)} MB/s</Text>
<Text>ETA: {progress.etaSeconds.toFixed(0)} seconds</Text>
<Button title="Pause" onPress={pause} />
</View>
)}
{status === 'done' && <Text>✅ Saved at: {result?.filePath}</Text>}
</View>
);
}
How It Compares
| Feature | rn-file-toolkit |
react-native-fs & rn-fetch-blob
|
|---|---|---|
| Background Persistence | ✅ Yes | ⚠️ Spotty / Legacy |
| Smart Queueing | ✅ Built-in | ❌ Write your own |
| React Hooks | ✅ Out-of-the-box | ❌ Manual |
| Auto-Retries | ✅ Yes | ❌ Manual |
| Zero 3rd-party Deps | ✅ Yes | ❌ Varies |
Try It Out
If you’re tired of stitching together multiple unmaintained libraries just to download a file reliably, give rn-file-toolkit a try.
- GitHub: https://github.com/chavan-labs/rn-file-toolkit
- NPM: https://www.npmjs.com/package/rn-file-toolkit
- Docs: https://chavan-labs.github.io/rn-file-toolkit/
I'd love to hear your feedback, feature requests, or see any PRs! ⭐ Drop a star on the repo if you find it useful.
Top comments (0)