mafintosh/tar-fs

filter by header/metadata

chpio opened this issue · 2 comments

chpio commented

is there a possibility to filter files by the metadata (called header)?

passing the header to the ignore func should do the job:

    if (ignore(name)) {
      stream.resume()
      return next()
    }

https://github.com/mafintosh/tar-fs/blob/master/index.js#L224-L227

    if (ignore(name, header)) {
      stream.resume()
      return next()
    }

but this is only the export side. but we need the import side also to generate and pass the header or just pass no header to the import ignore func but that would lead to an asymmetric api.

i'm fine with passing the header as the 2nd arg on extract only. wanna send a pr for that?

fixed in 1.11.0 by you :)