Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-url-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-url-polyfill

A lightweight and trustworthy URL polyfill for React Native

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
688K
decreased by-4.5%
Maintainers
1
Weekly downloads
 
Created

What is react-native-url-polyfill?

The react-native-url-polyfill package provides a polyfill for the URL and URLSearchParams classes in React Native environments. This is particularly useful for ensuring compatibility with web standards and APIs that rely on these classes.

What are react-native-url-polyfill's main functionalities?

URL Polyfill

This feature provides a polyfill for the URL class, allowing you to create and manipulate URL objects in a React Native environment just as you would in a web browser.

import 'react-native-url-polyfill/auto';

const url = new URL('https://example.com/path?name=ReactNative');
console.log(url.hostname); // 'example.com'
console.log(url.pathname); // '/path'
console.log(url.searchParams.get('name')); // 'ReactNative'

URLSearchParams Polyfill

This feature provides a polyfill for the URLSearchParams class, enabling you to work with query string parameters in a React Native environment.

import 'react-native-url-polyfill/auto';

const params = new URLSearchParams('name=ReactNative&version=0.64');
console.log(params.get('name')); // 'ReactNative'
console.log(params.get('version')); // '0.64'
params.append('platform', 'iOS');
console.log(params.toString()); // 'name=ReactNative&version=0.64&platform=iOS'

Other packages similar to react-native-url-polyfill

Keywords

FAQs

Package last updated on 13 Jul 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc