-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.json
54 lines (54 loc) · 5 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{
"name": "tar-pack",
"version": "2.0.0",
"description": "Package and un-package modules of some sort (in tar/gz bundles).",
"scripts": {
"test": "mocha -R list"
},
"repository": {
"type": "git",
"url": "https://github.com/ForbesLindesay/tar-pack.git"
},
"license": "BSD",
"optionalDependencies": {
"graceful-fs": "1.2"
},
"dependencies": {
"uid-number": "0.0.3",
"once": "~1.1.1",
"debug": "~0.7.2",
"rimraf": "~2.2.0",
"fstream": "~0.1.22",
"tar": "~0.1.17",
"fstream-ignore": "0.0.7",
"readable-stream": "~1.0.2",
"graceful-fs": "1.2"
},
"devDependencies": {
"mocha": "*",
"rfile": "*",
"mkdirp": "*"
},
"readme": "# Tar Pack\r\n\r\nPackage and un-package modules of some sort (in tar/gz bundles). This is mostly useful for package managers. Note that it doesn't check for or touch `package.json` so it can be used even if that's not the way you store your package info.\r\n\r\n[![Build Status](https://travis-ci.org/ForbesLindesay/tar-pack.png?branch=master)](https://travis-ci.org/ForbesLindesay/tar-pack)\r\n[![Dependency Status](https://gemnasium.com/ForbesLindesay/tar-pack.png)](https://gemnasium.com/ForbesLindesay/tar-pack)\r\n[![NPM version](https://badge.fury.io/js/tar-pack.png)](http://badge.fury.io/js/tar-pack)\r\n\r\n## Installation\r\n\r\n $ npm install tar-pack\r\n\r\n## API\r\n\r\n### pack(folder|packer, [options])\r\n\r\nPack the folder at `folder` into a gzipped tarball and return the tgz as a stream. Files ignored by `.gitignore` will not be in the package.\r\n\r\nYou can optionally pass a `fstream.DirReader` directly, instead of folder. For example, to create an npm package, do:\r\n\r\n```js\r\npack(require(\"fstream-npm\")(folder), [options])\r\n```\r\n\r\nOptions:\r\n\r\n - `noProprietary` (defaults to `false`) Set this to `true` to prevent any proprietary attributes being added to the tarball. These attributes are allowed by the spec, but may trip up some poorly written tarball parsers.\r\n - `ignoreFiles` (defaults to `['.gitignore']`) These files can specify files to be excluded from the package using the syntax of `.gitignore`. This option is ignored if you parse a `fstream.DirReader` instead of a string for folder.\r\n - `filter` (defaults to `entry => true`) A function that takes an entry and returns `true` if it should be included in the package and `false` if it should not. Entryies are of the form `{path, basename, dirname, type}` where (type is \"Directory\" or \"File\"). This function is ignored if you parse a `fstream.DirReader` instead of a string for folder.\r\n\r\nExample:\r\n\r\n```js\r\nvar write = require('fs').createWriteStream\r\nvar pack = require('tar-pack').pack\r\npack(process.cwd())\r\n .pipe(write(__dirname + '/package.tar.gz'))\r\n .on('error', function (err) {\r\n console.error(err.stack)\r\n })\r\n .on('close', function () {\r\n console.log('done')\r\n })\r\n```\r\n\r\n### unpack(folder, [options,] cb)\r\n\r\nReturn a stream that unpacks a tarball into a folder at `folder`. N.B. the output folder will be removed first if it already exists.\r\n\r\nThe callback is called with an optional error and, as its second argument, a string which is one of:\r\n\r\n - `'directory'`, indicating that the extracted package was a directory (either `.tar.gz` or `.tar`)\r\n - `'file'`, incating that the extracted package was just a single file (extracted to `defaultName`, see options)\r\n\r\nBasic Options:\r\n\r\n - `defaultName` (defaults to `index.js`) If the package is a single file, rather than a tarball, it will be \"extracted\" to this file name, set to `false` to disable.\r\n\r\nAdvanced Options (you probably don't need any of these):\r\n\r\n - `gid` - (defaults to `null`) the `gid` to use when writing files\r\n - `uid` - (defaults to `null`) the `uid` to use when writing files\r\n - `dmode` - (defaults to `0777`) The mode to use when creating directories\r\n - `fmode` - (defaults to `0666`) The mode to use when creating files\r\n - `unsafe` - (defaults to `false`) (on non win32 OSes it overrides `gid` and `uid` with the current processes IDs)\r\n\r\nExample:\r\n\r\n```js\r\nvar read = require('fs').createReadStream\r\nvar unpack = require('tar-pack').unpack\r\nread(process.cwd() + '/package.tar.gz')\r\n .pipe(unpack(__dirname + '/package/', function (err) {\r\n if (err) console.error(err.stack)\r\n else console.log('done')\r\n }))\r\n```\r\n\r\n## License\r\n\r\n BSD",
"readmeFilename": "README.md",
"_id": "tar-pack@2.0.0",
"dist": {
"shasum": "c2c401c02dd366138645e917b3a6baa256a9dcab",
"tarball": "http://registry.npmjs.org/tar-pack/-/tar-pack-2.0.0.tgz"
},
"_from": "tar-pack@~2.0.0",
"_npmVersion": "1.2.10",
"_npmUser": {
"name": "forbeslindesay",
"email": "forbes@lindesay.co.uk"
},
"maintainers": [
{
"name": "forbeslindesay",
"email": "forbes@lindesay.co.uk"
}
],
"directories": {},
"_shasum": "c2c401c02dd366138645e917b3a6baa256a9dcab",
"_resolved": "https://registry.npmjs.org/tar-pack/-/tar-pack-2.0.0.tgz"
}