Socket
Socket
Sign inDemoInstall

metro-resolver

Package Overview
Dependencies
0
Maintainers
2
Versions
138
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    metro-resolver

🚇 Implementation of Metro's resolution logic.


Version published
Weekly downloads
2M
decreased by-4.12%
Maintainers
2
Install size
100 kB
Created
Weekly downloads
 

Package description

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

Readme

Source

metro-resolver

🚇 Metro resolution logic

FAQs

Last updated on 18 Dec 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc