Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

find-modules

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

find-modules

Recursively find modules in node_modules

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
2
Created
Source

find-modules

NPM

Build Status Dependency Status

Recursively find all modules in the node_modules folder.

Example

var findModules = require('find-modules');

findModules(process.cwd(), done);
function done(err, modules) {
    // err contains error if any occurred

    modules.forEach(function(m) {
        console.log(m);
    });
}

// Example output:
// <cwd>/node_modules/foo
// <cwd>/node_modules/foo/node_modules/bar
// <cwd>/node_modules/baz

Reference

findModules(dir, callback)

Recursively finds all module directories in the node_modules folders. dir is the root directory to start the search. callback will be called when completed. The first parameter passed to callback is an error if any occurred, otherwise null. The second parameter is an array of paths of the the module directories that were found.

Keywords

modules

FAQs

Package last updated on 13 Jul 2015

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