
Product
Introducing Historical Analytics – Now in Beta
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.
module-resolver
Advanced tools
Asynchronous implementation of the node require.resolve()
algorithm
except you can pass in the file to compute paths relatively to along with your
own require.paths
without updating the global copy (which doesn't even work in
node >=0.5
).
var resolve = require('node-module-resolver');
Asynchronously search for the package/filename string pkg
according to the require.resolve()
algorithm
for X=pkg
and Y=opts.basedir
. Callback is fired with the located module or
without arguments if nothing is found.
opts
{
paths : [],
basedir : __dirname,
extensions : [ '.js' ],
readFileSync : fs.readFileSync,
isFile : function (file) {
return path.existSync(file) && fs.statSync(file).isFile()
}
}
Optionally you can specify a opts.packageFilter
function to map the contents
of JSON.parse()
'd package.json files.
If nothing is found, all of the directories in opts.paths
are searched.
Return whether a package is in core.
To the Node team for documenting what their mad-cap system is, and James Halliday for the synchronous implementation Node-Module-Resolver is forked from.
FAQs
Asynchronous require.resolve() implementation
We found that module-resolver demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.
Product
Module Reachability filters out unreachable CVEs so you can focus on vulnerabilities that actually matter to your application.
Company News
Socket is bringing best-in-class reachability analysis into the platform — cutting false positives, accelerating triage, and cementing our place as the leader in software supply chain security.