npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-client

v0.0.2

Published

react-native-client

Readme

react-native-client

MIT License Platform - Android Platform - iOS

A high-performance native HTTP client for React Native, built with Nitro Modules.

Features

  • File download
    • Native performance — Uses URLSession on iOS and OkHttp on Android
    • Resumable downloads — Pause and resume downloads with HTTP Range requests
    • Background downloads — Continue downloading while the app is in the background
    • Progress tracking — Real-time onProgress and begin callbacks
    • Configurable timeouts — Set connection and read timeouts independently

Installation

npm install react-native-client react-native-nitro-modules
# or
yarn add react-native-client react-native-nitro-modules
# or
bun add react-native-client react-native-nitro-modules

iOS

cd ios && pod install

Android

No additional steps required — Gradle handles everything automatically.

Usage

Basic download

import { downloadFile, documentDirectoryPath } from 'react-native-client'

const result = await downloadFile({
  fromUrl: 'https://example.com/file.zip',
  toFile: `${documentDirectoryPath}/file.zip`,
})

console.log(`Status: ${result.statusCode}, Bytes: ${result.bytesWritten}`)

Download with progress

import { downloadFile, documentDirectoryPath } from 'react-native-client'

const result = await downloadFile({
  fromUrl: 'https://example.com/large-file.zip',
  toFile: `${documentDirectoryPath}/large-file.zip`,
  begin: (statusCode, contentLength) => {
    console.log(`Download started — ${contentLength} bytes`)
  },
  onProgress: (bytesWritten, contentLength) => {
    const percent = ((bytesWritten / contentLength) * 100).toFixed(1)
    console.log(`${percent}%`)
  },
})

Resumable background download

import { downloadFile, documentDirectoryPath } from 'react-native-client'

const result = await downloadFile({
  fromUrl: 'https://example.com/large-file.zip',
  toFile: `${documentDirectoryPath}/large-file.zip`,
  resumable: true,
  background: true,
  connectionTimeout: 30000,
  readTimeout: 30000,
  onProgress: (bytesWritten, contentLength) => {
    console.log(`${bytesWritten} / ${contentLength}`)
  },
})

API

downloadFile(config: DownloadConfig): Promise<DownloadResult>

Downloads a file from a remote URL to a local path.

documentDirectoryPath: string

The app's document directory path, useful as a base path for toFile.

DownloadConfig

| Property | Type | Required | Description | |---|---|---|---| | fromUrl | string | Yes | URL to download from | | toFile | string | Yes | Local file path to save to | | resumable | boolean | No | Enable resumable downloads via HTTP Range | | background | boolean | No | Continue download in the background | | discretionary | boolean | No | iOS only — marks the transfer as discretionary | | progressDivider | number | No | Controls progress callback frequency | | connectionTimeout | number | No | Connection timeout in milliseconds | | readTimeout | number | No | Read timeout in milliseconds | | onProgress | (bytesWritten, contentLength) => void | No | Called periodically with download progress | | begin | (statusCode, contentLength) => void | No | Called when the download begins |

DownloadResult

| Property | Type | Description | |---|---|---| | statusCode | number | HTTP status code (200, 206, etc.) | | bytesWritten | number | Total bytes written to disk |

Contributing

Contributions are welcome! This library is actively growing and we appreciate help from the community.

Getting Started

  1. Fork the repository
  2. Clone your fork:
    git clone https://github.com/<your-username>/react-native-client.git
  3. Install dependencies:
    bun install
  4. Create a branch for your changes:
    git checkout -b feat/my-feature

Development

# Type check
bun run typecheck

# Lint
bun run lint

# Regenerate Nitro specs after changing .nitro.ts files
bun run specs

# Regenerate nitrogen bindings after changing Client.nitro.ts
bunx nitrogen

License

This project is licensed under the MIT License - see the LICENSE file for details.