locate used modules
npm install -g jut
jut [options] --module <modulename>
Options are:
--module, -m <modulename>
Find files that require<modulename>
--dir, -d <dirname>
Search files in<dirname>
recursively--file, -f <filename>
Search<filename>
for modules--justmatch, -j
Just print the filename that matches--fullpath, -F
Print full path to matched file--require, -r <name>
Specify a different function name fromrequire
--nocolor, -n
Don't colorize results--version, -v
Print current version--help, -h
Print help
in order to support searching for "deep-requires", (such as
module-name/sub-module
) searching for a "local" file (such as
../../module-name/sub-module
) requires a leading ./
in the module name.
jut(['array', 'of', 'module', './names'], ['aliases']) -> DuplexStream
stream it filenames, and get out objects with match objects. something like:
var jut = require('jut')
var ls = require('ls-stream') // for example
var convert = require('dotpath-stream')
var filter = require('stream-police')
ls('apps')
.pipe(convert('path')) // reduce ls-stream object to path string
.pipe(filter(function (data) {
return /\.js$/.test(data.toString()) // only js files
}))
.pipe(jut(['falafel'])) // right over to jut
.on('data', function (data) {
console.log(data) // {filename: fullpath, line: lineNumber, module: 'falafel'}
})
MIT