Socket
Socket
Sign inDemoInstall

browser-resolve-sync

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    browser-resolve-sync

synchronous resolve algorithm with browser field support


Version published
Weekly downloads
1
Maintainers
1
Install size
48.8 kB
Created
Weekly downloads
 

Readme

Source

browser-resolve-sync Build Status

Node.js resolve algorithm with browser field support.

This is 1:1 port of Roman Shtylman's asynchronous browser-resolve module.

API

resolve(pkg, opts={})

Resolve a module and return the full path.

Options:

  • filename - the calling filename where the require call originated (in the source)
  • paths - require.paths array to use if nothing is found on the normal node_modules recursive walk
  • packageFilter - transform the parsed package.json contents before looking at the "main" field
  • modules - object with module id/name -> path mappings to consult before doing manual resolution (use to provide core modules)
  • extensions - array of file extensions to search in order

License

MIT

Keywords

FAQs

Last updated on 12 Mar 2014

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