/node-matchdep

Use minimatch to filter npm module dependencies by name.

Primary LanguageJavaScriptMIT LicenseMIT

matchdep Build Status

Use minimatch to filter npm module dependencies by name.

Examples

var matchdep = require('matchdep');

// Filter dependencies (with autoloading of package.json from cwd)
matchdep.filter('mini*');

// Filter devDependencies (with config string indicating file to be required)
matchdep.filterDev('grunt-contrib*', './package.json');

// Filter all dependencies (with explicit config provided)
matchdep.filterAll('*', require('./package.json'));

Usage

filter(pattern, config)
filterDev(pattern, config)
filterAll(pattern, config)

pattern

Type: String Default: none

minimatch compatible pattern to filter dependencies.

config

Type: String or Object Default: path.resolve(process.cwd(),'package.json')

If config is a string, matchdep will attempt to require it. If it is an object, it will be used directly.