@zkochan/pnpm
Version:
Fast, disk space efficient package manager
115 lines (114 loc) • 8.57 kB
JSON
{
"_args": [
[
{
"raw": "tar-fs@^1.14.0",
"scope": null,
"escapedName": "tar-fs",
"name": "tar-fs",
"rawSpec": "^1.14.0",
"spec": ">=1.14.0 <2.0.0",
"type": "range"
},
"/home/zkochan/src/pnpm/packages/pnpm/node_modules/unpack-stream"
]
],
"_from": "tar-fs@>=1.14.0 <2.0.0",
"_id": "tar-fs@1.16.3",
"_inCache": true,
"_location": "/tar-fs",
"_nodeVersion": "10.3.0",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/tar-fs_1.16.3_1529482839287_0.9628256030497233"
},
"_npmUser": {
"name": "mafintosh",
"email": "mathiasbuus@gmail.com"
},
"_npmVersion": "6.1.0",
"_phantomChildren": {
"end-of-stream": "1.4.1",
"once": "1.4.0"
},
"_requested": {
"raw": "tar-fs@^1.14.0",
"scope": null,
"escapedName": "tar-fs",
"name": "tar-fs",
"rawSpec": "^1.14.0",
"spec": ">=1.14.0 <2.0.0",
"type": "range"
},
"_requiredBy": [
"/unpack-stream"
],
"_resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.3.tgz",
"_shasum": "966a628841da2c4010406a82167cbd5e0c72d509",
"_shrinkwrap": null,
"_spec": "tar-fs@^1.14.0",
"_where": "/home/zkochan/src/pnpm/packages/pnpm/node_modules/unpack-stream",
"author": {
"name": "Mathias Buus"
},
"bugs": {
"url": "https://github.com/mafintosh/tar-fs/issues"
},
"dependencies": {
"chownr": "^1.0.1",
"mkdirp": "^0.5.1",
"pump": "^1.0.0",
"tar-stream": "^1.1.2"
},
"description": "filesystem bindings for tar-stream",
"devDependencies": {
"rimraf": "^2.2.8",
"standard": "^4.5.4",
"tape": "^3.0.0"
},
"directories": {
"test": "test"
},
"dist": {
"integrity": "sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==",
"shasum": "966a628841da2c4010406a82167cbd5e0c72d509",
"tarball": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.3.tgz",
"fileCount": 16,
"unpackedSize": 27601,
"npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbKg5YCRA9TVsSAnZWagAAxLcP/3ciyULwU9bea6dkO8g+\nlfnHf8GQGSuEVTXRCVNFN9oF9WxX793561Kr+blU2dRdn+B10PBeuUpdgFKd\nJn6DE2Tq77GMRKwUQbcNl/G4RMFPIKOd51yDn5mZjZVFYEF2TjOHYN6bJaWk\nbDch+WDzVuoTSQWOpz27dF9vLUFXMNTaJi2rb1WtXR4TzgVftfKhZtuFYYFv\nIN1Cs2jlI3L5aoUfJwNSBswpyJ2fZE65/IC/Drxa+GflFJO0KZ1GjdEhZx9v\n4pug+ASPqvA+Vx+EyZrv3wO6rpSz7+15jpFMtUeaArxp4QnNMDs+ogKBfQGp\n/j0wYxDFkajUyejxzBC5+XJr0Hoi8gmlQYCczD8O2fFvH5EeqNbmRLszpbri\nT2BFTRDFdEEQRIYvMzXlGxqE7KY+BPttONx6Iy0YpJMfKt0Jp4tmdPaE2kQO\nzvb5qtSf+7CzSzVRE9pXsksXYSDls1RA1w3NMCWtDQQE6zt/JtSogUsmWiAO\nlvT2JaGiphzh5aB6hnopfvY8CNJmz5BLODtdknw/z9Ab7Q2BL+7HkL2cQ/HX\n2yk41jmxswcN1ats6MapfprYYnlLmlK6oD5zIpk0ucbsXjVRndi7qvpScBvs\nk8wF7C08Kbhxnyj1t70ny8Pb5VetG/qno+wxJcFE5RpUMGUojrjP5cppXUmJ\nBhTI\r\n=Uk1O\r\n-----END PGP SIGNATURE-----\r\n"
},
"gitHead": "873cda1e15503b1686aa544b4420f42bd6aa55a5",
"homepage": "https://github.com/mafintosh/tar-fs",
"keywords": [
"tar",
"fs",
"file",
"tarball",
"directory",
"stream"
],
"license": "MIT",
"main": "index.js",
"maintainers": [
{
"name": "mafintosh",
"email": "mathiasbuus@gmail.com"
},
{
"name": "maxogden",
"email": "max@maxogden.com"
}
],
"name": "tar-fs",
"optionalDependencies": {},
"readme": "# tar-fs\n\nfilesystem bindings for [tar-stream](https://github.com/mafintosh/tar-stream).\n\n```\nnpm install tar-fs\n```\n\n[](http://travis-ci.org/mafintosh/tar-fs)\n\n## Usage\n\ntar-fs allows you to pack directories into tarballs and extract tarballs into directories.\n\nIt doesn't gunzip for you, so if you want to extract a `.tar.gz` with this you'll need to use something like [gunzip-maybe](https://github.com/mafintosh/gunzip-maybe) in addition to this.\n\n``` js\nvar tar = require('tar-fs')\nvar fs = require('fs')\n\n// packing a directory\ntar.pack('./my-directory').pipe(fs.createWriteStream('my-tarball.tar'))\n\n// extracting a directory\nfs.createReadStream('my-other-tarball.tar').pipe(tar.extract('./my-other-directory'))\n```\n\nTo ignore various files when packing or extracting add a ignore function to the options. `ignore`\nis also an alias for `filter`. Additionally you get `header` if you use ignore while extracting.\nThat way you could also filter by metadata.\n\n``` js\nvar pack = tar.pack('./my-directory', {\n ignore: function(name) {\n return path.extname(name) === '.bin' // ignore .bin files when packing\n }\n})\n\nvar extract = tar.extract('./my-other-directory', {\n ignore: function(name) {\n return path.extname(name) === '.bin' // ignore .bin files inside the tarball when extracing\n }\n})\n\nvar extractFilesDirs = tar.extract('./my-other-other-directory', {\n ignore: function(_, header) {\n // pass files & directories, ignore e.g. symlinks\n return header.type !== 'file' && header.type !== 'directory'\n }\n})\n```\n\nYou can also specify which entries to pack using the `entries` option\n\n```js\nvar pack = tar.pack('./my-directory', {\n entries: ['file1', 'subdir/file2'] // only the specific entries will be packed\n})\n```\n\nIf you want to modify the headers when packing/extracting add a map function to the options\n\n``` js\nvar pack = tar.pack('./my-directory', {\n map: function(header) {\n header.name = 'prefixed/'+header.name\n return header\n }\n})\n\nvar extract = tar.extract('./my-directory', {\n map: function(header) {\n header.name = 'another-prefix/'+header.name\n return header\n }\n})\n```\n\nSimilarly you can use `mapStream` incase you wanna modify the input/output file streams\n\n``` js\nvar pack = tar.pack('./my-directory', {\n mapStream: function(fileStream, header) {\n if (path.extname(header.name) === '.js') {\n return fileStream.pipe(someTransform)\n }\n return fileStream;\n }\n})\n\nvar extract = tar.extract('./my-directory', {\n mapStream: function(fileStream, header) {\n if (path.extname(header.name) === '.js') {\n return fileStream.pipe(someTransform)\n }\n return fileStream;\n }\n})\n```\n\nSet `options.fmode` and `options.dmode` to ensure that files/directories extracted have the corresponding modes\n\n``` js\nvar extract = tar.extract('./my-directory', {\n dmode: parseInt(555, 8), // all dirs should be readable\n fmode: parseInt(444, 8) // all files should be readable\n})\n```\n\nIt can be useful to use `dmode` and `fmode` if you are packing/unpacking tarballs between *nix/windows to ensure that all files/directories unpacked are readable.\n\nAlternatively you can set `options.readable` and/or `options.writable` to set the dmode and fmode to readable/writable.\n\n``` js\nvar extract = tar.extract('./my-directory', {\n readable: true, // all dirs and files should be readable\n writable: true, // all dirs and files should be writable\n})\n```\n\nSet `options.strict` to `false` if you want to ignore errors due to unsupported entry types (like device files)\n\nTo dereference symlinks (pack the contents of the symlink instead of the link itself) set `options.dereference` to `true`.\n\n## Copy a directory\n\nCopying a directory with permissions and mtime intact is as simple as\n\n``` js\ntar.pack('source-directory').pipe(tar.extract('dest-directory'))\n```\n\n## Interaction with [`tar-stream`](https://github.com/mafintosh/tar-stream)\n\nUse `finalize: false` and the `finish` hook to\nleave the pack stream open for further entries (see\n[`tar-stream#pack`](https://github.com/mafintosh/tar-stream#packing)),\nand use `pack` to pass an existing pack stream.\n\n``` js\nvar mypack = tar.pack('./my-directory', {\n finalize: false,\n finish: function(sameAsMypack) {\n mypack.entry({name: 'generated-file.txt'}, \"hello\")\n tar.pack('./other-directory', {\n pack: sameAsMypack\n })\n }\n})\n```\n\n\n## Performance\n\nPacking and extracting a 6.1 GB with 2496 directories and 2398 files yields the following results on my Macbook Air.\n[See the benchmark here](https://gist.github.com/mafintosh/8102201)\n\n* tar-fs: 34.261 ms\n* [node-tar](https://github.com/isaacs/node-tar): 366.123 ms (or 10x slower)\n\n## License\n\nMIT\n",
"readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git+https://github.com/mafintosh/tar-fs.git"
},
"scripts": {
"test": "standard && tape test/index.js"
},
"version": "1.16.3"
}