
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
react-native-du
Advanced tools
A file download utility for react native
npm install react-native-du
or
yarn add react-native-du
import * as React from 'react';
import { StyleSheet, View, Button } from 'react-native';
import {
downloadFile,
downloadStatus,
DOWNLOAD_MANAGER_STATUS,
} from 'react-native-du';
export default function App() {
const downloadPdf = async () => {
try {
const id = await downloadFile({
url: 'https://cdn.pixabay.com/photo/2017/11/09/21/41/cat-2934720_1280.jpg',
fileName: 'cat.jpg',
desc: 'This is a cat ',
});
console.log({ id });
const status = await downloadStatus(id?.[0] || '');
const idx: string = status?.[0] || '';
console.log({ status: DOWNLOAD_MANAGER_STATUS[idx] });
} catch (err) {
console.log(err);
}
};
return (
<View style={styles.container}>
<Button title="Download" onPress={downloadPdf} />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
box: {
width: 60,
height: 60,
marginVertical: 20,
},
});
async function downloadFile({
url,
fileName,
desc = '',
onPermissionDenied,
onError,
})
// params
{
url : 'https://cdn.pixabay.com/photo/2017/11/09/21/41/cat-2934720_1280.jpg' // request url,
fileName: 'cat.jpg' // file Name with extension
desc: 'Description of download manager' // optional
onPermissionDenied: ()=>{} // optional , this function gets called if storgae permission is denied
onError: (error)=>{} // optional , this function gets called if any exception is thrown
}
// returns
['downloadId'] or undefined
async function downloadStatus(downloadId: string)
// params
{
downloadId : 'id' // download id returned by downloadFile function,
}
// returns
['download_manager_status'] or undefined
You might have to add following permission in AndroidManifest.xml file
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library
FAQs
A file download utility for react native
The npm package react-native-du receives a total of 0 weekly downloads. As such, react-native-du popularity was classified as not popular.
We found that react-native-du demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.