deps/npm/lib/cache.js
function ls_ (req, depth, cb) {
  if (typeof cb !== "function") cb = depth, depth = 1
  mkdir(npm.cache, function (er) {
    if (er) return log.er(cb, "no cache dir")(er)
    function dirFilter (f, type) {
      return type !== "dir" ||
        ( f && f !== npm.cache + "/" + req
         && f !== npm.cache + "/" + req + "/" )
    }
    find(path.join(npm.cache, req), dirFilter, depth, function (er, files) {
      if (er) return cb(er)
      return cb(null, files.map(function (f) {
        f = f.substr(npm.cache.length + 1)
        f = f.substr((f === req ? path.dirname(req) : req).length)
             .replace(/^\//, '')
        return f
      }))
    })
  })
}
function ls_ (req, depth, cb) {
  if (typeof cb !== "function") cb = depth, depth = 1
  mkdir(npm.cache, function (er) {
    if (er) return log.er(cb, "no cache dir")(er)
    function dirFilter (f, type) {
      return type !== "dir" ||
        ( f && f !== npm.cache + "/" + req
         && f !== npm.cache + "/" + req + "/" )
    }
    find(path.join(npm.cache, req), dirFilter, depth, function (er, files) {
      if (er) return cb(er)
      return cb(null, files.map(function (f) {
        f = f.substr(npm.cache.length + 1)
        f = f.substr((f === req ? path.dirname(req) : req).length)
             .replace(/^\//, '')
        return f
      }))
    })
  })
}
function ls_ ( req , depth , cb ) { if ( typeof cb !== "function" ) cb = depth , depth = 1 mkdir ( npm . cache , function ( er ) { if ( er ) return log . er ( cb , "no cache dir" ) ( er ) function dirFilter ( f , type ) { return type !== "dir" || ( f && f !== npm . cache + "/" + req && f !== npm . cache + "/" + req + "/" ) } find ( path . join ( npm . cache , req ) , dirFilter , depth , function ( er , files ) { if ( er ) return cb ( er ) return cb ( null , files . map ( function ( f ) { f = f . substr ( npm . cache . length + 1 ) f = f . substr ( ( f === req ? path . dirname ( req ) : req ) . length ) . replace ( / ^\/ / , '' ) return f } ) ) } ) } ) }
Calls cb with list of cached pkgs matching show.
Calls cb with list of cached pkgs matching show .