🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

browser-resolve

Package Overview
Dependencies
Maintainers
40
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browser-resolve

resolve which handles browser field support in package.json

2.0.0
latest
Source
npm
Version published
Weekly downloads
4.1M
-8.32%
Maintainers
40
Weekly downloads
 
Created

What is browser-resolve?

The browser-resolve npm package is designed to resolve module dependencies in a way that is compatible with how browsers resolve modules, as opposed to the Node.js resolution algorithm. This is particularly useful for bundling packages for use in the browser where the Node.js module resolution strategy (e.g., handling of the 'main' field in package.json) does not apply.

What are browser-resolve's main functionalities?

Resolving browser-specific module entry points

This feature allows developers to resolve the path to a module's browser-specific entry point, if specified in the module's package.json, instead of the Node.js entry point. This is useful for bundling modules for the browser.

var resolve = require('browser-resolve');
resolve('module-name', { filename: '/path/to/file.js' }, function (err, res) {
  if (err) console.log(err);
  console.log(res);
});

Other packages similar to browser-resolve

Keywords

resolve

FAQs

Package last updated on 03 Aug 2020

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