Socket
Socket
Sign inDemoInstall

metro-resolver

Package Overview
Dependencies
Maintainers
0
Versions
144
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.


Version published
Weekly downloads
2.6M
decreased by-3.77%
Maintainers
0
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 08 Sep 2024

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