browser-resolve-sync

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i browser-resolve-sync

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • fgnass