index.js
function saveFiles(path, opts, obj, cb) {
  const noDot = opts.noDot
  var root  = ''

  walk.walk(path, walkFn, function (err) {
    if (err) cb(err)
    cb(null, obj)
  })

  function walkFn(baseDir, filename, stat, next) {
    if (!root) root = baseDir
    baseDir = stripLeadingSlash(baseDir.split(root)[1])

    if (stat.isDirectory()) return next()
    if (noDot) {
      if (/^\./.test(filename)) return next()
    }
    pushArr(baseDir, obj, filename)
    next()
  }
}
function saveFiles(path, opts, obj, cb) {
  const noDot = opts.noDot
  var root  = ''

  walk.walk(path, walkFn, function (err) {
    if (err) cb(err)
    cb(null, obj)
  })

  function walkFn(baseDir, filename, stat, next) {
    if (!root) root = baseDir
    baseDir = stripLeadingSlash(baseDir.split(root)[1])

    if (stat.isDirectory()) return next()
    if (noDot) {
      if (/^\./.test(filename)) return next()
    }
    pushArr(baseDir, obj, filename)
    next()
  }
}
function saveFiles ( path , opts , obj , cb ) { const noDot = opts . noDot var root = '' walk . walk ( path , walkFn , function ( err ) { if ( err ) cb ( err ) cb ( null , obj ) } ) function walkFn ( baseDir , filename , stat , next ) { if ( ! root ) root = baseDir baseDir = stripLeadingSlash ( baseDir . split ( root ) [ 1 ] ) if ( stat . isDirectory ( ) ) return next ( ) if ( noDot ) { if ( / ^\. / . test ( filename ) ) return next ( ) } pushArr ( baseDir , obj , filename ) next ( ) } }
Save filenames in dir structure. @param {String} path @param {Object} opts @param {Object} obj @param {Function} cb
Save filenames in dir structure .