5 [![NPM](https://nodei.co/npm/tar.png)](https://nodei.co/npm/tar/)
9 See `examples/` for usage examples.
11 ### var tar = require('tar')
13 Returns an object with `.Pack`, `.Extract` and `.Parse` methods.
15 ### tar.Pack([properties])
17 Returns a through stream. Use
18 [fstream](https://npmjs.org/package/fstream) to write files into the
19 pack stream and you will receive tar archive data from the pack
22 This only works with directories, it does not work with individual files.
24 The optional `properties` object are used to set properties in the tar
25 'Global Extended Header'. If the `fromBase` property is set to true,
26 the tar will contain files relative to the path passed, and not with
29 ### tar.Extract([options])
31 Returns a through stream. Write tar data to the stream and the files
32 in the tarball will be extracted onto the filesystem.
38 path: '/path/to/extract/tar/into',
39 strip: 0, // how many path segments to strip from the root when extracting
43 `options` also get passed to the `fstream.Writer` instance that `tar`
48 Returns a writable stream. Write tar data to it and it will emit
49 `entry` events for each entry parsed from the tarball. This is used by