@zkochan/pnpm
Version:
Fast, disk space efficient package manager
132 lines (131 loc) • 9.66 kB
JSON
{
"_args": [
[
{
"raw": "tar-stream@^1.1.2",
"scope": null,
"escapedName": "tar-stream",
"name": "tar-stream",
"rawSpec": "^1.1.2",
"spec": ">=1.1.2 <2.0.0",
"type": "range"
},
"/home/zkochan/src/pnpm/packages/pnpm/node_modules/tar-fs"
]
],
"_from": "tar-stream@>=1.1.2 <2.0.0",
"_id": "tar-stream@1.6.1",
"_inCache": true,
"_location": "/tar-stream",
"_nodeVersion": "9.11.1",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/tar-stream_1.6.1_1526332743849_0.4437324256027526"
},
"_npmUser": {
"name": "mafintosh",
"email": "mathiasbuus@gmail.com"
},
"_npmVersion": "5.6.0",
"_phantomChildren": {},
"_requested": {
"raw": "tar-stream@^1.1.2",
"scope": null,
"escapedName": "tar-stream",
"name": "tar-stream",
"rawSpec": "^1.1.2",
"spec": ">=1.1.2 <2.0.0",
"type": "range"
},
"_requiredBy": [
"/tar-fs"
],
"_resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.1.tgz",
"_shasum": "f84ef1696269d6223ca48f6e1eeede3f7e81f395",
"_shrinkwrap": null,
"_spec": "tar-stream@^1.1.2",
"_where": "/home/zkochan/src/pnpm/packages/pnpm/node_modules/tar-fs",
"author": {
"name": "Mathias Buus",
"email": "mathiasbuus@gmail.com"
},
"bugs": {
"url": "https://github.com/mafintosh/tar-stream/issues"
},
"dependencies": {
"bl": "^1.0.0",
"buffer-alloc": "^1.1.0",
"end-of-stream": "^1.0.0",
"fs-constants": "^1.0.0",
"readable-stream": "^2.3.0",
"to-buffer": "^1.1.0",
"xtend": "^4.0.0"
},
"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.",
"devDependencies": {
"concat-stream": "^1.6.2",
"standard": "^11.0.1",
"tape": "^4.9.0"
},
"directories": {
"test": "test"
},
"dist": {
"integrity": "sha512-IFLM5wp3QrJODQFPm6/to3LJZrONdBY/otxcvDIQzu217zKye6yVR3hhi9lAjrC2Z+m/j5oDxMPb1qcd8cIvpA==",
"shasum": "f84ef1696269d6223ca48f6e1eeede3f7e81f395",
"tarball": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.1.tgz",
"fileCount": 7,
"unpackedSize": 26782,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa+f1JCRA9TVsSAnZWagAAnWkP/jHPHuyNZ/H3BaXHWUQ7\nIZ3ukXdSYH+ZGSgM6/JcRz91xFiejwnCuX8tjwgjjpeHn7wpM4/taINZge3I\n13Xc9uF+zabqnO542jH4pCjrztE8hovGM1IDoZtwi6H4uinuLkYY27WsTGCO\ncSC74aUDU9LZx7hrIfnvq5PYhm4X3rEV0EcSmG9I+lusha2GU6BKw2CFQpAO\nvERga3WM4tFOSKFagu1gvReU/77Lyw376M1eAghMV2ZjUV/CyVMyzzvC4S2u\n1k/Lq81XcODc2mNl9M8HNuQMaPusqT4XzJnjzL4kVUYiwhdr7Lncq29dufDZ\n7TS1HZgWJQezFg+pnlspTgpkLrS5uDk6JncCM/wbgpyGP1q8lv/LKYbvk1D4\nvBpTzK7Qay7h8/Re7liu0zJXnO1cXwHauaO+WQXkpPBFGOoDvPugbyq6E8OV\nMtzm6QMrvmfe9hkgndII3Oj08ga6DKP9DF/nDxNZ9UPGkriczhVYsHJO4Ujp\nmH+UxqC18uruZzJlUju6VXsV4ufEBraaZ8KkGBjnV376054tnkOJIDTwjk1M\nbfdABGfeMXHJsM9+exUVnGEhIKeSszxiYpACiQFgUNpP1hDFU3aUchOYEUc0\nXamSbx7md5wqCVN0l6q+1YADEzJoWpkGBWojWZZY30jw5PJvuT0e4/VsKxrg\noD/a\r\n=qby5\r\n-----END PGP SIGNATURE-----\r\n"
},
"engines": {
"node": ">= 0.8.0"
},
"files": [
"*.js",
"LICENSE"
],
"gitHead": "9f9ccbc127ffd599e6219af94e8cfe2dd1ca823a",
"homepage": "https://github.com/mafintosh/tar-stream",
"keywords": [
"tar",
"tarball",
"parse",
"parser",
"generate",
"generator",
"stream",
"stream2",
"streams",
"streams2",
"streaming",
"pack",
"extract",
"modify"
],
"license": "MIT",
"main": "index.js",
"maintainers": [
{
"name": "mafintosh",
"email": "mathiasbuus@gmail.com"
},
{
"name": "maxogden",
"email": "max@maxogden.com"
}
],
"name": "tar-stream",
"optionalDependencies": {},
"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\nNote that you still need to gunzip your data if you have a `.tar.gz`. We recommend using [gunzip-maybe](https://github.com/mafintosh/gunzip-maybe) in conjunction with this.\n\n```\nnpm install tar-stream\n```\n\n[](http://travis-ci.org/mafintosh/tar-stream)\n[](http://opensource.org/licenses/MIT)\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\nIt implementes USTAR with additional support for pax extended headers. It should be compatible with all popular tar distributions out there (gnutar, bsdtar etc)\n\n## Related\n\nIf you want to pack/unpack directories on the file system check out [tar-fs](https://github.com/mafintosh/tar-fs) which provides file system bindings to this module.\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() // pack 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', size: 11 }, function(err) {\n // the stream was added\n // no more entries\n pack.finalize()\n})\n\nentry.write('hello')\nentry.write(' ')\nentry.write('world')\nentry.end()\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, next) )`\n\n``` js\nvar extract = tar.extract()\n\nextract.on('entry', function(header, stream, next) {\n // header is the tar header\n // stream is the content body (might be an empty stream)\n // call next when you are done with this entry\n\n stream.on('end', function() {\n next() // ready for next entry\n })\n\n stream.resume() // just auto drain the stream\n})\n\nextract.on('finish', function() {\n // all entries read\n})\n\npack.pipe(extract)\n```\n\nThe tar archive is streamed sequentially, meaning you **must** drain each entry's stream as you get them or else the main extract stream will receive backpressure and stop reading.\n\n## Headers\n\nThe header object using in `entry` should contain the following properties.\nMost of these values can be found by stat'ing a file.\n\n``` js\n{\n name: 'path/to/this/entry.txt',\n size: 1314, // entry size. defaults to 0\n mode: 0644, // entry mode. defaults to to 0755 for dirs and 0644 otherwise\n mtime: new Date(), // last modified date for entry. defaults to now.\n type: 'file', // type of entry. defaults to file. can be:\n // file | link | symlink | directory | block-device\n // character-device | fifo | contiguous-file\n linkname: 'path', // linked file name\n uid: 0, // uid of entry owner. defaults to 0\n gid: 0, // gid of entry owner. defaults to 0\n uname: 'maf', // uname of entry owner. defaults to null\n gname: 'staff', // gname of entry owner. defaults to null\n devmajor: 0, // device major version. defaults to 0\n devminor: 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 // let's prefix all names with 'tmp'\n header.name = path.join('tmp', header.name)\n // write the new entry to the pack stream\n stream.pipe(pack.entry(header, callback))\n})\n\nextract.on('finish', function() {\n // all entries done - lets finalize it\n pack.finalize()\n})\n\n// pipe the old tarball to the extractor\noldTarballStream.pipe(extract)\n\n// pipe the new tarball the another stream\npack.pipe(newTarballStream)\n```\n\n## Saving tarball to fs\n\n\n``` js\nvar fs = require('fs')\nvar tar = require('tar-stream')\n\nvar pack = tar.pack() // pack is a streams2 stream\nvar path = 'YourTarBall.tar'\nvar yourTarball = fs.createWriteStream(path)\n\n// add a file called YourFile.txt with the content \"Hello World!\"\npack.entry({name: 'YourFile.txt'}, 'Hello World!', function (err) {\n if (err) throw err\n pack.finalize()\n})\n\n// pipe the pack stream to your file\npack.pipe(yourTarball)\n\nyourTarball.on('close', function () {\n console.log(path + ' has been written')\n fs.stat(path, function(err, stats) {\n if (err) throw err\n console.log(stats)\n console.log('Got file info successfully!')\n })\n})\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",
"repository": {
"type": "git",
"url": "git+https://github.com/mafintosh/tar-stream.git"
},
"scripts": {
"test": "standard && tape test/extract.js test/pack.js",
"test-all": "standard && tape test/*.js"
},
"version": "1.6.1"
}