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

bare-module-resolve

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bare-module-resolve

Low-level module resolution algorithm for Bare

1.0.1
Version published
Weekly downloads
35K
-11.94%
Maintainers
2
Weekly downloads
 
Created

bare-module-resolve

Low-level module resolution algorithm for Bare.

npm i bare-module-resolve

Usage

const resolve = require('bare-module-resolve')

function readPackage (url) {
  if (url.href === 'file:///directory/package.json') {
    return {
      main: './index.js'
    }
  }

  return null
}

for (const resolution of resolve('./file', new URL('file:///directory/'), { extensions: ['.js'] }, readPackage)) {
  console.log(resolution)
}

License

Apache-2.0

FAQs

Package last updated on 27 Nov 2023

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