Gathering detailed insights and metrics for react-native-url-polyfill
Gathering detailed insights and metrics for react-native-url-polyfill
Gathering detailed insights and metrics for react-native-url-polyfill
Gathering detailed insights and metrics for react-native-url-polyfill
react-native-filereader
HTML5 FileAPI `FileReader` for React Native
@zitterorg/magni-eos
[![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![dependency status][deps-svg]][deps-url] [![dev dependency status][dev-deps-svg]][dev-deps-url] [![License][license-image]][license-url] [![Downloads][downloads-im
@dramaorg/delectus-culpa-reprehenderit
[![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![dependency status][deps-svg]][deps-url] [![dev dependency status][dev-deps-svg]][dev-deps-url] [![License][license-image]][license-url] [![Downloads][downloads-im
@crabas0npm2/laudantium-maxime-veritatis
[![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![dependency status][deps-svg]][deps-url] [![dev dependency status][dev-deps-svg]][dev-deps-url] [![License][license-image]][license-url] [![Downloads][downloads-im
🔗A lightweight and trustworthy URL polyfill for React Native.
npm install react-native-url-polyfill
Typescript
Module System
Node Version
NPM Version
61.4
Supply Chain
51.6
Quality
66
Maintenance
50
Vulnerability
94.1
License
Java (34.38%)
JavaScript (26.53%)
Ruby (10.71%)
Objective-C (7.44%)
Objective-C++ (6.99%)
C++ (6.56%)
Kotlin (2.35%)
TypeScript (1.54%)
Makefile (1.43%)
Starlark (1.13%)
Swift (0.89%)
Shell (0.05%)
Total Downloads
76,953,544
Last Day
35,070
Last Week
830,015
Last Month
3,627,160
Last Year
36,258,479
MIT License
371 Stars
329 Commits
24 Forks
2 Watchers
3 Branches
7 Contributors
Updated on Jun 24, 2025
Minified
Minified + Gzipped
Latest Version
2.0.0
Package Id
react-native-url-polyfill@2.0.0
Unpacked Size
26.86 kB
Size
8.60 kB
File Count
22
NPM Version
9.5.1
Node Version
18.16.1
Published on
Jul 13, 2023
Cumulative downloads
Total Downloads
Last Day
11%
35,070
Compared to previous day
Last Week
-8%
830,015
Compared to previous week
Last Month
0.5%
3,627,160
Compared to previous month
Last Year
43.9%
36,258,479
Compared to previous year
A lightweight and trustworthy URL polyfill for React Native
react-native-url-polyfill is an implementation of the WHATWG URL Standard optimized for React Native.
whatwg-url
(whatwg-url-without-unicode
) where unicode support has been stripped out — Going down from 372 KB to 40.9 KB.react-native-url-polyfill/auto
will be no-op on web.React Native does include a polyfill for URL
, but this polyfill is homemade — in order to keep it light-weight — and was initially created to handle specific use cases.
Meanwhile, React Native has grown around that polyfill, then some unexpected errors have arisen.
Known issues (non-exhaustive) with React Native's URL are:
- URL cannot handle "localhost" domain for base url react-native#26019.
- URL implementation should add a trailing slash to the base react-native#25717.
- URL incorrectly adds trailing slash react-native#24428.
- Creating an instance of URL like:
new URL('http://facebook.com')
throws an exception react-native#16434.
That's why you may need this external dependency. So, if you use URL
within your app, you probably want to take a look at the installation steps below!
Unfortunately, adding react-native-url-polyfill
to React Native source code would mean adding 📦 73.67 KB (as of RN 0.72) to the JavaScript bundle, that's why it's not included by default.
First, you need to install the polyfill, which can be done with Yarn or npm.
1yarn add react-native-url-polyfill
1npm install --save react-native-url-polyfill
Then, the polyfill can be used in multiple ways. Pick your preferred option.
ℹ️ To verify if the polyfill has been correctly applied, you can check if the global variable
REACT_NATIVE_URL_POLYFILL
contains the current package and version like:react-native-url-polyfill@CURRENT_VERSION
.
Locate your JavaScript entry-point file, commonly called index.js
at the root of your React Native project.
Then, import react-native-url-polyfill/auto
at the top of your entry-point file, the polyfill will be automatically applied.
1import 'react-native-url-polyfill/auto';
If you want to apply the polyfill when you're ready, you can import setupURLPolyfill
and call it yourself.
⚠️ Metro doesn't support optional imports.
If you do not apply the polyfill, it will still be added to your JavaScript bundle. Even if it's wrapped in a condition, Metro won't strip it in production.
1import { setupURLPolyfill } from 'react-native-url-polyfill'; 2 3setupURLPolyfill();
If you prefer not to apply this polyfill over React Native's default URL
, you can still import those classes manually when you want them.
1import { URL, URLSearchParams } from 'react-native-url-polyfill'; 2 3const url = new URL('https://github.com'); 4const searchParams = new URLSearchParams('q=GitHub');
react-native-url-polyfill is MIT licensed.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 3/30 approved changesets -- score normalized to 1
Reason
0 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
107 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More