root 3bf41bf355 update | 1 年間 前 | |
---|---|---|
.. | ||
lib | 1 年間 前 | |
node_modules | 1 年間 前 | |
.jshintrc | 1 年間 前 | |
.npmignore | 1 年間 前 | |
.travis.yml | 1 年間 前 | |
LICENSE-MIT | 1 年間 前 | |
README.md | 1 年間 前 | |
package.json | 1 年間 前 |
Use micromatch to filter npm module dependencies by name.
var matchdep = require('matchdep');
// Filter dependencies (by autoloading nearest package.json)
matchdep.filter('mini*');
// Filter devDependencies (with config string indicating file to be required)
matchdep.filterDev('grunt-contrib-*', './package.json');
// Filter peerDependencies (with config string indicating file to be required)
matchdep.filterPeer('foo-{bar,baz}', './some-other.json');
// Filter all dependencies (with explicit config provided)
matchdep.filterAll('*', require('./yet-another.json'));
// Filter all dependencies, exclude grunt (multiple matching patterns)
matchdep.filterAll(['*','!grunt']);
filter(pattern, config)
filterDev(pattern, config)
filterPeer(pattern, config)
filterAll(pattern, config)
Type: String|Array
Default: 'none'
A micromatch compatible match pattern to filter dependencies.
Type: String
or Object
Default: Path to nearest package.json.
If config is a string, matchdep will attempt to require it. If it is an object, it will be used directly.