matchmodule

Use minimatch to filter installed npm modules by name.

npm install matchmodule
42 downloads in the last day
197 downloads in the last week
937 downloads in the last month

Matchmodule

is a node module for matching strings against currently installed modules.

Inspired by Tyler Kellen's matchdep.

Examples

var matchmodule = require('matchmodule');
matchmodule.filter('grunt-contrib*');

Usage

filter(pattern)

pattern

Type: String Default: none

minimatch compatible pattern to filter installed modules.

Difference from Matchdep

I wanted to run grunt tasks from npm without adding them as dependencies, or without adding them to Gruntfile.js. By adding the following line to Gruntfile.js:

module.exports = function (grunt) {
    // load all installed grunt tasks
    require('matchmodule').filter('grunt-*').forEach(grunt.loadNpmTasks);
};

I can now do something like the following if I want to run a one time grunt task:

npm install grunt-contrib-jshint
grunt jshint

Copyright (c) 2013 Patrick Williams. See LICENSE for further details.

npm loves you