{
  "name": "tar-stream",
  "version": "0.3.3",
  "description": "tar-stream is a streaming tar parser and generator and nothing else. It is streams2 and operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system.",
  "repository": {
    "type": "git",
    "url": "git://github.com:mafintosh/tar-stream.git"
  },
  "author": {
    "name": "Mathias Buus",
    "email": "mathiasbuus@gmail.com"
  },
  "engines": {
    "node": ">= 0.8.0"
  },
  "dependencies": {
    "bl": "~0.6.0",
    "end-of-stream": "~0.1.3",
    "readable-stream": "~1.0.26-4"
  },
  "devDependencies": {
    "tap": "~0.4.6",
    "concat-stream": "~1.2.1"
  },
  "scripts": {
    "test": "tap test/*.js"
  },
  "keywords": [
    "tar",
    "tarball",
    "parse",
    "parser",
    "generate",
    "generator",
    "stream",
    "stream2",
    "streams",
    "streams2",
    "streaming",
    "pack",
    "extract",
    "modify"
  ],
  "readme": "# tar-stream\n\ntar-stream is a streaming tar parser and generator and nothing else. It is streams2 and operates purely using streams which means you can easily extract/parse tarballs without ever hitting the file system.\n\n\tnpm install tar-stream\n\n[![build status](https://secure.travis-ci.org/mafintosh/tar-stream.png)](http://travis-ci.org/mafintosh/tar-stream)\n\n# Usage\n\ntar-stream exposes two streams, [pack](https://github.com/mafintosh/tar-stream#packing) which creates tarballs and [extract](https://github.com/mafintosh/tar-stream#extracting) which extracts tarballs. To [modify an existing tarball](https://github.com/mafintosh/tar-stream#modifying-existing-tarballs) use both.\n\n## Packing\n\nTo create a pack stream use `tar.pack()` and call `pack.entry(header, [callback])` to add tar entries.\n\n``` js\nvar tar = require('tar-stream');\nvar pack = tar.pack(); // p is a streams2 stream\n\n// add a file called my-test.txt with the content \"Hello World!\"\npack.entry({ name: 'my-test.txt' }, 'Hello World!');\n\n// add a file called my-stream-test.txt from a stream\nvar entry = pack.entry({ name: 'my-stream-test.txt' }, function(err) {\n\t// the stream was added\n\t// no more entries\n\tpack.finalize();\n});\nmyStream.pipe(entry);\n\n// pipe the pack stream somewhere\npack.pipe(process.stdout);\n```\n\n## Extracting\n\nTo extract a stream use `tar.extract()` and listen for `extract.on('entry', header, stream, callback)`\n\n``` js\nvar extract = tar.extract();\n\nextract.on('entry', function(header, stream, callback) {\n\t// header is the tar header\n\t// stream is the content body (might be an empty stream)\n\t// call next when you are done with this entry\n\n\tstream.resume(); // just auto drain the stream\n\tstream.on('end', function() {\n\t\tcallback(); // ready for next entry\n\t});\n});\n\nextract.on('finish', function() {\n\t// all entries read\n});\n\npack.pipe(extract);\n```\n\n## Headers\n\nThe header object using in `entry` should contain the following properties.\nMost of these values can be found by stating a file.\n\n``` js\n{\n\tname: 'path/to/this/entry.txt',\n\tsize: 1314,        // entry size. defaults to 0\n\tmode: 0644,        // entry mode. defaults to to 0755 for dirs and 0644 otherwise\n\tmtime: new Date(), // last modified date for entry. defaults to now.\n\ttype: 'file',      // type of entry. defaults to file. can be:\n\t                   // file | link | symlink | directory | block-device\n\t                   // character-device | fifo | contigious-file\n\tlinkname: 'path',  // linked file name\n\tuid: 0,            // uid of entry owner. defaults to 0\n\tgid: 0,            // gid of entry owner. defaults to 0\n\tuname: 'maf',      // uname of entry owner. defaults to null\n\tgname: 'staff',    // gname of entry owner. defaults to null\n\tdevmajor: 0,       // device major version. defaults to 0\n\tdevminor: 0        // device minor version. defaults to 0\n}\n```\n\n## Modifying existing tarballs\n\nUsing tar-stream it is easy to rewrite paths / change modes etc in an existing tarball.\n\n``` js\nvar extract = tar.extract();\nvar pack = tar.pack();\nvar path = require('path');\n\nextract.on('entry', function(header, stream, callback) {\n\t// let's prefix all names with 'tmp'\n\theader.name = path.join('tmp', header.name);\n\t// write the new entry to the pack stream\n\tstream.pipe(pack.entry(header, callback));\n});\n\nextract.on('finish', function() {\n\t// all entries done - lets finalize it\n\tpack.finalize();\n});\n\n// pipe the old tarball to the extractor\noldTarball.pipe(extract);\n\n// pipe the new tarball the another stream\npack.pipe(newTarball);\n```\n\n## Performance\n\n[See tar-fs for a performance comparison with node-tar](https://github.com/mafintosh/tar-fs/blob/master/README.md#performance)\n\n# License\n\nMIT\n",
  "readmeFilename": "README.md",
  "bugs": {
    "url": "https://github.com/mafintosh/tar-stream/issues"
  },
  "homepage": "https://github.com/mafintosh/tar-stream",
  "_id": "tar-stream@0.3.3",
  "dist": {
    "shasum": "23ca53bd738b8702272a80e26cc938bc4b84b87b"
  },
  "_from": "tar-stream@~0.3.0",
  "_resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-0.3.3.tgz"
}
