How to use the matchdep.filterPeer function in matchdep

To help you get started, we’ve selected a few matchdep examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gruntjs / grunt-contrib / Gruntfile.js View on Github external
grunt.registerTask('build', function () {
    var done = this.async();
    var when = require('when');
    var request = require('request');
    var _ = require('lodash');
    var deps = require('matchdep').filterPeer('grunt-contrib-*');
    var baseurl = 'http://raw.github.com/gruntjs/'

    // make http request for author file in a repo
    var authorFile = function (dep) {
      var deferred = when.defer();
      var url = baseurl+dep+'/master/AUTHORS';
      request.get({url: url}, function(err, res, body) {
        if (res.statusCode != 200) {
          grunt.fail.fatal('Failed to retrieve '+url);
        } else {
          deferred.resolve(body.split('\n'));
        }
      });
      return deferred.promise
    };
github gruntjs / grunt-contrib / tasks / contrib.js View on Github external
module.exports = function(grunt) {

  // Load all grunt-contrib peerDependencies.
  require('matchdep').filterPeer('grunt-contrib-*').forEach(grunt.loadNpmTasks);

};

matchdep

Use micromatch to filter npm module dependencies by name.

MIT
Latest version published 7 years ago

Package Health Score

65 / 100
Full package analysis