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

metro-resolver

Package Overview
Dependencies
Maintainers
2
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metro-resolver

🚇 Implementation of Metro's resolution logic.

  • 0.73.10
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.9M
increased by4.15%
Maintainers
2
Weekly downloads
 
Created

What is metro-resolver?

The metro-resolver npm package is a module resolution library used primarily in the Metro bundler, which is the JavaScript bundler for React Native. It helps in resolving modules by locating and identifying the correct files within a project's structure based on specific resolution rules and configurations.

What are metro-resolver's main functionalities?

Custom Resolution Strategies

Allows the implementation of custom resolution strategies for modules, enabling developers to define how modules are resolved based on the platform or other conditions.

const { resolve } = require('metro-resolver');

const context = { originModulePath: '/path/to/module.js', redirectModulePath: undefined, resolveRequest: null, platform: 'ios', moduleName: './otherModule' };
const result = resolve(context, moduleName, platform);

Platform Specific Resolutions

Supports resolving platform-specific versions of modules, such as distinguishing between iOS and Android specific code files in a React Native project.

const { resolve } = require('metro-resolver');

const context = { originModulePath: '/path/to/module.js', redirectModulePath: undefined, resolveRequest: null, platform: 'android', moduleName: './component' };
const result = resolve(context, moduleName, platform);

Other packages similar to metro-resolver

FAQs

Package last updated on 07 Jun 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