index.js
function ls (dir, cb) {
  if(!cb) cb = dir, dir = null

  dir = dir || process.cwd()

  pull(
    pfs.ancestors(dir),
    pfs.resolve('node_modules'),
    pfs.star(),
    pull.filter(Boolean),
    paramap(maybe(readPackage)),
    filter(),
    pull.unique('name'),
    pull.reduce(function (obj, val) {
      if(!obj[val.name])
        obj[val.name] = val
      return obj
    }, {}, function (err, obj) {
      cb(err, obj)
    })
  )
}
function ls (dir, cb) {
  if(!cb) cb = dir, dir = null

  dir = dir || process.cwd()

  pull(
    pfs.ancestors(dir),
    pfs.resolve('node_modules'),
    pfs.star(),
    pull.filter(Boolean),
    paramap(maybe(readPackage)),
    filter(),
    pull.unique('name'),
    pull.reduce(function (obj, val) {
      if(!obj[val.name])
        obj[val.name] = val
      return obj
    }, {}, function (err, obj) {
      cb(err, obj)
    })
  )
}
function ls ( dir , cb ) { if ( ! cb ) cb = dir , dir = null dir = dir || process . cwd ( ) pull ( pfs . ancestors ( dir ) , pfs . resolve ( 'node_modules' ) , pfs . star ( ) , pull . filter ( Boolean ) , paramap ( maybe ( readPackage ) ) , filter ( ) , pull . unique ( 'name' ) , pull . reduce ( function ( obj , val ) { if ( ! obj [ val . name ] ) obj [ val . name ] = val return obj } , { } , function ( err , obj ) { cb ( err , obj ) } ) ) }
retrive the current files,
retrive the current files