Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
metro-resolver
Advanced tools
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.
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);
A module resolution package similar to metro-resolver but more generic and not tied to any specific framework or platform. It provides a greater level of customization and is used in various Node.js environments.
Part of the webpack ecosystem, enhanced-resolve is used to resolve files and directories in a highly configurable manner. It offers more features and plugins compared to metro-resolver, tailored for web development environments.
🚇 Metro resolution logic
FAQs
🚇 Implementation of Metro's resolution logic.
We found that metro-resolver demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
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.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.