Socket
Book a DemoInstallSign in
Socket

metro-resolver

Package Overview
Dependencies
Maintainers
2
Versions
158
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.83.1
latest
Source
npmnpm
Version published
Weekly downloads
3.6M
2.9%
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 24 Jul 2025

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with āš”ļø by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.