Skip to content

Use micromatch to filter npm module dependencies by name.

License

Notifications You must be signed in to change notification settings

BrandonCopley/js-matchdep

This branch is 9 commits ahead of, 7 commits behind tkellen/js-matchdep:master.

Folders and files

NameName
Last commit message
Last commit date
Feb 8, 2016
Feb 8, 2016
Nov 27, 2012
Oct 8, 2013
Apr 7, 2013
Dec 29, 2015
Oct 9, 2013
Apr 7, 2013
Feb 9, 2016
Nov 17, 2016

Repository files navigation

matchdep Build Status

Use micromatch to filter npm module dependencies by name.

NPM

Examples

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']);

Usage

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

pattern

Type: String|Array Default: 'none'

A micromatch compatible match pattern to filter dependencies.

config

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.

Release History

  • 2016-02-09 - v1.0.1 - switch to micromatch, remove globule
  • 2015-09-27 - v1.0.0 - throw when no package.json found, update dependencies, remove node 0.8 support
  • 2013-10-09 - v0.3.0 - support multiple pattern matches using globule
  • 2013-10-08 - v0.2.0 - refactor and support filtering peerDependencies
  • 2012-11-27 - v0.1.0 - initial release

About

Use micromatch to filter npm module dependencies by name.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%