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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-real-fetch

v0.1.3

Published

A native Fetch API implementation for React Native.

Readme

react-native-real-fetch

A not-so-perfect Fetch API implementation that’s good enough to do what React Native’s fetch can’t.

What does this do better ?

  • No weird Cookie header behavior — it does not store previous Set-Cookie headers in an internal cookie jar. You have to manage them yourself.
  • redirect: "manual" finally prevents any redirection from happening.

Limitations

On both Android and iOS, the statusText property depends on the OS' implementation. It will not retrieve the status text from the server.

Basically, whatever you can do with fetch should be possible here — just check the types to ensure the variables you're passing are supported.

Since I initially developed this for personal use, only basic functionality is supported. If you need advanced features like signal for aborting requests, they likely aren’t supported.

Please open an issue if there's something essential you need that isn’t supported.

Installation

React Native

npm add react-native-real-fetch react-native-nitro-modules@^0.28.1
cd ios && pod install

Expo

npx expo add react-native-real-fetch react-native-nitro-modules@^0.28.1
npx expo prebuild

Usages

import { fetch } from "react-native-real-fetch";

const response = await fetch("https://api.github.com");
const json = await response.json();
import { fetch } from "react-native-real-fetch";

const { status, headers } = await fetch("http://api.local.dev/api/login", {
  method: "POST",
  redirect: "manual",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ username, password }),
});

if (status === 200) {
  const cookies = headers.get("set-cookie");
  console.log(cookies);
}
import { fetch } from "react-native-real-fetch";

const response = await fetch("http://api.local.dev/api/user", {
  headers: { Cookie: "session=some_token; lang=en" },
  // Only the given cookies will be sent, no stored additional cookies will be sent !
  // In fact, nothing is stored.
});

const bytes = await response.bytes();
console.log(bytes); // > Uint8Array

Android configuration for using http:

Since Android 9 (API level 28), cleartext (http:) traffic is restricted by default. To allow it, you need to explicitly enable it.

Allowing HTTP for All Domains

To enable HTTP for all domains, add the following to your AndroidManifest.xml.

<application
    android:usesCleartextTraffic="true"
    ... >
</application>

Allowing HTTP for Specific Domains Only

If you prefer to allow HTTP traffic only for specific domains, use a networkSecurityConfig instead.

<application
  android:networkSecurityConfig="@xml/network_security_config"
  ... >
</application>

Then, create a res/xml/network_security_config.xml file to define the domain-specific configuration.

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
  <domain-config cleartextTrafficPermitted="true">
    <domain includeSubdomains="true">yourdomain.com</domain>
  </domain-config>
</network-security-config>

Contributing

git clone https://github.com/Vexcited/react-native-real-fetch
cd react-native-real-fetch/package
bun install

After making your changes, you can build the package with the following commands.

bun run clean
bun run codegen
bun run build

To see how to run the example app, head over to the example folder.

Credits