Comparing version 0.2.2 to 0.3.0
@@ -51,2 +51,3 @@ var tar = require('tar-stream'); | ||
var ignore = opts.ignore || noop; | ||
var map = opts.map || noop; | ||
var statNext = statAll(cwd, ignore); | ||
@@ -95,2 +96,4 @@ var pack = tar.pack(); | ||
header = map(header) || header | ||
var entry = pack.entry(header, onnextentry); | ||
@@ -122,2 +125,3 @@ if (!entry) return; | ||
var ignore = opts.ignore || noop; | ||
var map = opts.map || noop | ||
var own = opts.chown !== false && !win32 && process.getuid() === 0; | ||
@@ -174,2 +178,3 @@ var extract = tar.extract(); | ||
extract.on('entry', function(header, stream, next) { | ||
header = map(header) || header | ||
var name = path.join(cwd, path.join('/', header.name)); | ||
@@ -222,2 +227,2 @@ | ||
return extract; | ||
}; | ||
}; |
{ | ||
"name": "tar-fs", | ||
"version": "0.2.2", | ||
"version": "0.3.0", | ||
"description": "filesystem bindings for tar-stream", | ||
@@ -5,0 +5,0 @@ "repository": "git://github.com:mafintosh/tar-fs.git", |
@@ -40,2 +40,20 @@ # tar-fs | ||
If you want to modify the headers when packing/extracting add a map function to the options | ||
``` js | ||
var pack = tar.pack('./my-directory', { | ||
map: function(header) { | ||
header.name = 'prefixed/'+header.name; | ||
return header; | ||
} | ||
}); | ||
var extract = tar.pack('./my-directory', { | ||
map: function(header) { | ||
header.name = 'another-prefix/'+header.name; | ||
return header; | ||
} | ||
}); | ||
``` | ||
Set `options.fmode` and `options.dmode` to ensure that files/directories extracted have the corresponding modes | ||
@@ -42,0 +60,0 @@ |
10854
249
88