
Security News
curl Shuts Down Bug Bounty Program After Flood of AI Slop Reports
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.
find-module
Advanced tools
find a module from a require path asyncronously using custom module folders
Find a module specified by a require path using Node's module resolution.
npm install find-module
var findModule = require('find-module');
findModule('./some-path', {
dirname: 'some-parent-dir' // the directory from which ./some-path should be resolved
}, function(err, filename) {
console.log('some-path resolved to '+filename+' from some-parent-dir');
});
// or dont provide a callback to use the sync version
var filename = findModule('./some-path', {
dirname: 'some-parent-dir' // the directory from which ./some-path should be resolved
});
console.log('some-path resolved to '+filename+' from some-parent-dir');
If you pass a module path ('my-module') find-module by default will look for a node_modules folder
to find my-module. If you want to use a different module folder you can set the modules option
findModule('my-module', {
modules: 'custom_modules',
dirname: 'some-parent-dir'
}, ...);
When you resolve a path find-module by default will look for path+'.js' and path+'.json' if the
path does not exist. If you want to look for other kind of extensions set the extensions option
findModule('my-module', {
dirname: 'some-parent-dir',
extensions: ['txt']
}, ...);
Combine the modules and extensions settings to roll out your own module finder. A template module
finder could look like this
findModule('my-template', {
dirname: 'some-parent-dir',
modules: 'templates',
extensions: ['html']
}, ...);
MIT
FAQs
find a module from a require path asyncronously using custom module folders
The npm package find-module receives a total of 2 weekly downloads. As such, find-module popularity was classified as not popular.
We found that find-module 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.

Security News
A surge of AI-generated vulnerability reports has pushed open source maintainers to rethink bug bounties and tighten security disclosure processes.

Product
Scan results now load faster and remain consistent over time, with stable URLs and on-demand rescans for fresh security data.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.