0.0.4 • Published 10 years ago

search-modules v0.0.4

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

search-modules

Build Status

Install

$ npm install search-modules

Examples

Search modules with name

var search = require('search-modules');

// geunt or /^grunt-/ or (/^gulp/ and /gulp$/)

search(module.paths)
  .filter('name', 'grunt', /^grunt-/, [/^gulp/, /gulp$/])
  .on('data', function (pkg) {
    console.log('%s: %s', pkg.name, pkg.dir);
  })

Search modules with keywords

var search = require('search-modules');

// stream and gulp

search(module.paths)
  .filter('keywords', ['stream', 'gulp'])
  .on('data', function (pkg) {
    console.log('%s: %s', pkg.name, pkg.dir);
  })

// grunt or gulp

search(module.paths)
  .filter('keywords', 'grunt', 'gulp')
  .on('data', function (pkg) {
    console.log('%s: %s', pkg.name, pkg.dir);
  })

License

The MIT License (MIT)

http://poying.mit-license.org/