react-native-chunked-dl
TypeScript icon, indicating that this package has built-in type declarations

0.2.3 • Public • Published

react-native-chunked-dl

Chunked download for react-native

Installation

npm install react-native-chunked-dl

Usage

import { download, stopDownload } from 'react-native-chunked-dl';

// ...

const {
    jobId,
    promise
} = download({
    url: 'https://google.com',
    toFile: FS.DocumentDirectoryPath + '/playback.m4a',
    contentLength: 3548166,
    chunkSize: 1024 * 1024 * 10,
    headers: {
        'Content-Type': 'application/text',
    }
});

promise.then((result) => {
    console.log(result.statusCode)
}).catch((err) => {
    console.log(err)
});

setTimeout(() => {
    stopDownload(jobId)
}, 1000)

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

/react-native-chunked-dl/

    Package Sidebar

    Install

    npm i react-native-chunked-dl

    Weekly Downloads

    1

    Version

    0.2.3

    License

    MIT

    Unpacked Size

    45.3 kB

    Total Files

    24

    Last publish

    Collaborators

    • spicy_sparks